Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade rust to 1.77.0 nightly - 2024-02-01 #4022

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
jgreat marked this conversation as resolved.
Show resolved Hide resolved

[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
Loading