Skip to content

Commit

Permalink
Merge #1776: ci: automated update to rustc 1.83.0
Browse files Browse the repository at this point in the history
272ce22 ci: update build_docs job to use rust nightly (Steve Myers)
1755480 ci: use prepared rust-version instead of stable for all jobs (Steve Myers)
173cc42 ci(clippy): fix updated ptr_arg check for rust 1.83 (Steve Myers)
1d03db9 ci(clippy): fix new default warn empty_line_after_doc_comments for rust 1.83 (Steve Myers)
941bca0 ci(clippy): fix new stricter needless_lifetime errors for rust 1.83 (Steve Myers)
2586e1e ci: automated update to rustc 1.83.0 (Github Action)

Pull request description:

  Automated update to Github CI workflow `cont_integration.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

  I manually fixed new clippy warnings.

  I also changed CI to:
  ~~1. not build or run tests or test dependencies when building with MSRV.  This reduced the number of dependencies we need to pin for MSRV and fixes 1398.~~ I removed these changes.
  2. use the same version or rust as in the `rust-version` file for all jobs instead of just for clippy. I made this change to prevent CI breaks when stable changes before we have a chance to fix the auto created PR that bumps the `rust-version` file.

ACKs for top commit:
  oleonardolima:
    tACK 272ce22
  nymius:
    tACK 272ce22
  ValuedMammal:
    ACK 272ce22

Tree-SHA512: de3e9447e25f82474cd6902ade9dfad4145686b4084296d3fd2065e28bf811579bbaa18225d175372e7dd9914377c6e8260998ff991b0f482f19551884bbf9ca
  • Loading branch information
notmandatory committed Dec 17, 2024
2 parents dbc6a1e + 272ce22 commit 1a6a78a
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 31 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ jobs:
run: echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT

build-test:
needs: prepare
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: stable
- version: ${{ needs.prepare.outputs.rust_version }}
clippy: true
- version: 1.63.0 # MSRV
features:
Expand Down Expand Up @@ -60,6 +61,7 @@ jobs:
run: cargo test --workspace --exclude 'example_*' ${{ matrix.features }}

check-no-std:
needs: prepare
name: Check no_std
runs-on: ubuntu-latest
steps:
Expand All @@ -68,7 +70,7 @@ jobs:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
profile: minimal
# target: "thumbv6m-none-eabi"
Expand All @@ -88,6 +90,7 @@ jobs:
run: cargo check --no-default-features --features miniscript/no-std,bdk_chain/hashbrown

check-wasm:
needs: prepare
name: Check WASM
runs-on: ubuntu-20.04
env:
Expand All @@ -103,7 +106,7 @@ jobs:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
profile: minimal
target: "wasm32-unknown-unknown"
Expand All @@ -117,6 +120,7 @@ jobs:
run: cargo check --target wasm32-unknown-unknown --no-default-features --features miniscript/no-std,bdk_chain/hashbrown,async

fmt:
needs: prepare
name: Rust fmt
runs-on: ubuntu-latest
steps:
Expand All @@ -125,7 +129,7 @@ jobs:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
profile: minimal
components: rustfmt
Expand Down Expand Up @@ -153,6 +157,7 @@ jobs:
args: --all-features --all-targets -- -D warnings

build-examples:
needs: prepare
name: Build & Test Examples
runs-on: ubuntu-latest
strategy:
Expand All @@ -172,7 +177,7 @@ jobs:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
profile: minimal
- name: Rust Cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set default toolchain
run: rustup default nightly-2024-05-12
run: rustup default nightly
- name: Set profile
run: rustup set profile minimal
- name: Update toolchain
Expand Down
6 changes: 3 additions & 3 deletions crates/chain/src/tx_data_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub trait Anchor: core::fmt::Debug + Clone + Eq + PartialOrd + Ord + core::hash:
}
}

impl<'a, A: Anchor> Anchor for &'a A {
impl<A: Anchor> Anchor for &A {
fn anchor_block(&self) -> BlockId {
<A as Anchor>::anchor_block(self)
}
Expand Down Expand Up @@ -112,13 +112,13 @@ pub struct TxPosInBlock<'b> {
pub tx_pos: usize,
}

impl<'b> From<TxPosInBlock<'b>> for BlockId {
impl From<TxPosInBlock<'_>> for BlockId {
fn from(pos: TxPosInBlock) -> Self {
pos.block_id
}
}

impl<'b> From<TxPosInBlock<'b>> for ConfirmationBlockTime {
impl From<TxPosInBlock<'_>> for ConfirmationBlockTime {
fn from(pos: TxPosInBlock) -> Self {
Self {
block_id: pos.block_id,
Expand Down
6 changes: 3 additions & 3 deletions crates/chain/src/tx_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub struct TxNode<'a, T, A> {
pub last_seen_unconfirmed: Option<u64>,
}

impl<'a, T, A> Deref for TxNode<'a, T, A> {
impl<T, A> Deref for TxNode<'_, T, A> {
type Target = T;

fn deref(&self) -> &Self::Target {
Expand Down Expand Up @@ -1350,7 +1350,7 @@ where
}
}

impl<'g, A, F, O> Iterator for TxAncestors<'g, A, F, O>
impl<A, F, O> Iterator for TxAncestors<'_, A, F, O>
where
F: FnMut(usize, Arc<Transaction>) -> Option<O>,
{
Expand Down Expand Up @@ -1470,7 +1470,7 @@ where
}
}

impl<'g, A, F, O> Iterator for TxDescendants<'g, A, F, O>
impl<A, F, O> Iterator for TxDescendants<'_, A, F, O>
where
F: FnMut(usize, Txid) -> Option<O>,
{
Expand Down
2 changes: 1 addition & 1 deletion crates/chain/tests/test_local_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ enum ExpectedResult<'a> {
Err(CannotConnectError),
}

impl<'a> TestLocalChain<'a> {
impl TestLocalChain<'_> {
fn run(mut self) {
let got_changeset = match self.chain.apply_update(self.update) {
Ok(changeset) => changeset,
Expand Down
10 changes: 5 additions & 5 deletions crates/core/src/spk_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub enum SyncItem<'i, I> {
OutPoint(OutPoint),
}

impl<'i, I: core::fmt::Debug + core::any::Any> core::fmt::Display for SyncItem<'i, I> {
impl<I: core::fmt::Debug + core::any::Any> core::fmt::Display for SyncItem<'_, I> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
SyncItem::Spk(i, spk) => {
Expand Down Expand Up @@ -485,7 +485,7 @@ struct KeychainSpkIter<'r, K> {
inspect: &'r mut Box<InspectFullScan<K>>,
}

impl<'r, K: Ord + Clone> Iterator for KeychainSpkIter<'r, K> {
impl<K: Ord + Clone> Iterator for KeychainSpkIter<'_, K> {
type Item = Indexed<ScriptBuf>;

fn next(&mut self) -> Option<Self::Item> {
Expand All @@ -511,7 +511,7 @@ impl<'r, I, Item> SyncIter<'r, I, Item> {

impl<'r, I, Item> ExactSizeIterator for SyncIter<'r, I, Item> where SyncIter<'r, I, Item>: Iterator {}

impl<'r, I> Iterator for SyncIter<'r, I, ScriptBuf> {
impl<I> Iterator for SyncIter<'_, I, ScriptBuf> {
type Item = ScriptBuf;

fn next(&mut self) -> Option<Self::Item> {
Expand All @@ -524,7 +524,7 @@ impl<'r, I> Iterator for SyncIter<'r, I, ScriptBuf> {
}
}

impl<'r, I> Iterator for SyncIter<'r, I, Txid> {
impl<I> Iterator for SyncIter<'_, I, Txid> {
type Item = Txid;

fn next(&mut self) -> Option<Self::Item> {
Expand All @@ -537,7 +537,7 @@ impl<'r, I> Iterator for SyncIter<'r, I, Txid> {
}
}

impl<'r, I> Iterator for SyncIter<'r, I, OutPoint> {
impl<I> Iterator for SyncIter<'_, I, OutPoint> {
type Item = OutPoint;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
4 changes: 2 additions & 2 deletions crates/file_store/src/entry_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<'t, T> EntryIter<'t, T> {
}
}

impl<'t, T> Iterator for EntryIter<'t, T>
impl<T> Iterator for EntryIter<'_, T>
where
T: serde::de::DeserializeOwned,
{
Expand Down Expand Up @@ -71,7 +71,7 @@ where
}
}

impl<'t, T> Drop for EntryIter<'t, T> {
impl<T> Drop for EntryIter<'_, T> {
fn drop(&mut self) {
// This syncs the underlying file's offset with the buffer's position. This way, we
// maintain the correct position to start the next read/write.
Expand Down
2 changes: 1 addition & 1 deletion crates/testenv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct Config<'a> {
pub electrsd: electrsd::Conf<'a>,
}

impl<'a> Default for Config<'a> {
impl Default for Config<'_> {
/// Use the default configuration plus set `http_enabled = true` for [`electrsd::Conf`]
/// which is required for testing `bdk_esplora`.
fn default() -> Self {
Expand Down
1 change: 0 additions & 1 deletion crates/wallet/examples/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use bdk_wallet::{KeychainKind, Wallet};
/// can be derived from the policy.
///
/// This example demonstrates the interaction between a bdk wallet and miniscript policy.
#[allow(clippy::print_stdout)]
fn main() -> Result<(), Box<dyn Error>> {
// We start with a miniscript policy string
Expand Down
1 change: 0 additions & 1 deletion crates/wallet/examples/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use bdk_wallet::signer::SignersContainer;
///
/// This example demos a Policy output for a 2of2 multisig between between 2 parties, where the wallet holds
/// one of the Extend Private key.
#[allow(clippy::print_stdout)]
fn main() -> Result<(), Box<dyn Error>> {
let secp = bitcoin::secp256k1::Secp256k1::new();
Expand Down
4 changes: 1 addition & 3 deletions crates/wallet/src/descriptor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ impl IntoWalletDescriptor for (ExtendedDescriptor, KeyMap) {
network: Network,
}

impl<'s, 'd> miniscript::Translator<DescriptorPublicKey, String, DescriptorError>
for Translator<'s, 'd>
{
impl miniscript::Translator<DescriptorPublicKey, String, DescriptorError> for Translator<'_, '_> {
fn pk(&mut self, pk: &DescriptorPublicKey) -> Result<String, DescriptorError> {
let secp = &self.secp;

Expand Down
2 changes: 1 addition & 1 deletion crates/wallet/src/keys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ impl fmt::Display for KeyError {
impl std::error::Error for KeyError {}

#[cfg(test)]
pub mod test {
mod test {
use bitcoin::bip32;

use super::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/wallet/src/wallet/coin_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ mod test {
.collect()
}

fn sum_random_utxos(mut rng: &mut StdRng, utxos: &mut Vec<WeightedUtxo>) -> Amount {
fn sum_random_utxos(mut rng: &mut StdRng, utxos: &mut [WeightedUtxo]) -> Amount {
let utxos_picked_len = rng.gen_range(2..utxos.len() / 2);
utxos.shuffle(&mut rng);
utxos[..utxos_picked_len]
Expand Down
2 changes: 1 addition & 1 deletion crates/wallet/src/wallet/persisted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl<P: AsyncWalletPersister> PersistedWallet<P> {
}

#[cfg(feature = "rusqlite")]
impl<'c> WalletPersister for bdk_chain::rusqlite::Transaction<'c> {
impl WalletPersister for bdk_chain::rusqlite::Transaction<'_> {
type Error = bdk_chain::rusqlite::Error;

fn initialize(persister: &mut Self) -> Result<ChangeSet, Self::Error> {
Expand Down
2 changes: 1 addition & 1 deletion crates/wallet/src/wallet/tx_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ impl<'a, Cs> TxBuilder<'a, Cs> {
}
}

impl<'a, Cs: CoinSelectionAlgorithm> TxBuilder<'a, Cs> {
impl<Cs: CoinSelectionAlgorithm> TxBuilder<'_, Cs> {
/// Finish building the transaction.
///
/// Uses the thread-local random number generator (rng).
Expand Down
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.82.0
1.83.0

0 comments on commit 1a6a78a

Please sign in to comment.