Skip to content

Commit

Permalink
Upgrade rust to 1.77.0 nightly - 2024-02-01 (#4022)
Browse files Browse the repository at this point in the history
* upgrade rust to 1.77.0 nightly - 2024-02-01
  • Loading branch information
jgreat authored Dec 13, 2024
1 parent 69e4cb4 commit 92b0d35
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ failure-output = "immediate-final"
status-level = "slow"
# Add retires for flaky tests
retries = { backoff = "exponential", count = 3, delay = "5s" }
# Limit threads to a "large" gha container max
test-threads = 22

[profile.ci.junit]
# Output a JUnit report under `target/nextest/ci/junit.xml`.
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

env:
CARGO_TERM_COLOR: always
CARGO_BUILD_JOBS: 22
RUST_BACKTRACE: 1
MC_TELEMETRY: 0
SKIP_SLOW_TESTS: 1
Expand Down
3 changes: 3 additions & 0 deletions connection/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ impl<C: Connection> Ord for SyncConnection<C> {
}
}

// this check maybe be buggy and fixed in later versions:
// https://github.com/rust-lang/rust-clippy/issues/12154
#[allow(clippy::unconditional_recursion)]
impl<C: Connection> PartialEq for SyncConnection<C> {
fn eq(&self, other: &Self) -> bool {
let self_g = self.read();
Expand Down
2 changes: 1 addition & 1 deletion fog/distribution/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ use tempfile::tempdir;

thread_local! {
/// global variable storing connections to the consensus network
static CONNS: RefCell<Option<Vec<SyncConnection<ThickClient<HardcodedCredentialsProvider>>>>> = RefCell::new(None);
static CONNS: RefCell<Option<Vec<SyncConnection<ThickClient<HardcodedCredentialsProvider>>>>> = const { RefCell::new(None) };
}

fn set_conns(config: &Config, logger: &Logger) {
Expand Down
4 changes: 2 additions & 2 deletions fog/test_infra/src/db_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub fn recovery_db_rng_records_decommissioning<DB: RecoveryDb>(
.unwrap();

// Test that user has rng record event now
let test_rows0 = vec![kex_rng_pubkey1];
let test_rows0 = [kex_rng_pubkey1];

let (user_events, next_start_from_user_event_id) = db.search_user_events(0).unwrap();
let rng_records: Vec<RngRecord> = user_events
Expand Down Expand Up @@ -292,7 +292,7 @@ pub fn recovery_db_rng_records_decommissioning<DB: RecoveryDb>(

// Check that if starting at next_start_from_user_event_id we only see the
// second rng
let test_rows1 = vec![kex_rng_pubkey2];
let test_rows1 = [kex_rng_pubkey2];

let (user_events, _next_start_from_user_event_id) = db
.search_user_events(next_start_from_user_event_id)
Expand Down
4 changes: 1 addition & 3 deletions fog/types/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ impl BlockRange {
) -> Option<(usize, BlockRange)> {
let mut ranges = ranges.into_iter();
let first = ranges.next().cloned();
let Some(mut merged_range) = first else {
return None;
};
let mut merged_range = first?;
let mut index = 0;

for range in ranges {
Expand Down
2 changes: 1 addition & 1 deletion fog/view/enclave/impl/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ mod shared_data_tests {
const STORE_COUNT: usize = 4;
let mut decrypted_query_responses = Vec::with_capacity(STORE_COUNT);

let missed_block_ranges = vec![
let missed_block_ranges = [
BlockRange::new(0, 1),
BlockRange::new(10, 12),
BlockRange::new(33, 100),
Expand Down
7 changes: 3 additions & 4 deletions mobilecoind-json/src/data_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1515,10 +1515,9 @@ mod test {
outlay.set_value(1234);

let outlay_index_to_tx_out_index = HashMap::from_iter(vec![(0, 0)]);
let outlay_confirmation_numbers =
vec![mc_transaction_extra::TxOutConfirmationNumber::from(
[0u8; 32],
)];
let outlay_confirmation_numbers = [mc_transaction_extra::TxOutConfirmationNumber::from(
[0u8; 32],
)];

// Make proto TxProposal
let mut proto_proposal = api::TxProposal::new();
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2023-12-21"
channel = "nightly-2024-02-03"
14 changes: 8 additions & 6 deletions util/build/enclave/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,14 @@ impl Builder {

let staticlib_target_dir = &self.target_dir;

// e.g. "mc_foo_enclave_trusted"
let staticlib_crate_name = self.staticlib.workspace_members[0]
.repr
.split_whitespace()
.next()
.ok_or(Error::TrustedCrateName)?;
// The workspace_members IDs have changed to this format:
// path+file:///tmp/mobilenode/consensus/enclave/trusted#[email protected]
// We want to capture everything after the last '#' and before the '@'
let workspace_id = self.staticlib.workspace_members[0].repr.clone();
let workspace_id_parts: Vec<&str> = workspace_id.split('#').collect();
let workspace_name = workspace_id_parts[1];
let workspace_name_parts: Vec<&str> = workspace_name.split('@').collect();
let staticlib_crate_name = workspace_name_parts[0];

// "target/name/<profile>/libmc_foo_enclave_trusted.a" -- not xplatform, but
// neither is our use of SGX, so meh.
Expand Down
4 changes: 4 additions & 0 deletions util/repr-bytes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,15 @@ macro_rules! derive_core_cmp_from_as_ref {
}
}

// this check maybe be buggy and fixed in later versions:
// https://github.com/rust-lang/rust-clippy/issues/12154
#[allow(clippy::unconditional_recursion)]
impl PartialEq for $mytype {
fn eq(&self, other: &Self) -> bool {
<Self as AsRef<$asref>>::as_ref(self).eq(<Self as AsRef<$asref>>::as_ref(other))
}
}

impl Eq for $mytype {}

impl ::core::hash::Hash for $mytype {
Expand Down
3 changes: 3 additions & 0 deletions util/u64-ratio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ impl U64Ratio {
}
}

// this check maybe be buggy and fixed in later versions:
// https://github.com/rust-lang/rust-clippy/issues/12154
#[allow(clippy::unconditional_recursion)]
impl PartialEq for U64Ratio {
#[inline]
fn eq(&self, other: &Self) -> bool {
Expand Down

0 comments on commit 92b0d35

Please sign in to comment.