-
Notifications
You must be signed in to change notification settings - Fork 2k
chore: bump to rust edition 2024 #10802
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -82,7 +82,6 @@ jobs: | |||
- uses: actions/checkout@v4 | |||
- uses: dtolnay/rust-toolchain@nightly | |||
with: | |||
toolchain: nightly-2024-02-03 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found out we were pinning to this specific nightly, this seems unintended / resolved
@@ -46,7 +46,7 @@ pub struct HexIdProvider { | |||
|
|||
impl HexIdProvider { | |||
/// Generates a random hex encoded Id | |||
pub fn gen(&self) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gen
is now a reserved keyword, found generate
better than r#gen
@@ -20,7 +20,7 @@ impl Cheatcode for setEnvCall { | |||
} else if value.contains('\0') { | |||
Err(fmt_err!("environment variable value can't contain NUL character `\\0`")) | |||
} else { | |||
env::set_var(key, value); | |||
unsafe { env::set_var(key, value); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsafe
is now required for things that touch the environment
fuzz_state.clone(), | ||
fuzz_fixtures.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to lifetime / ownership issues clone
is not required here - not ideal!
let settings = cache.profiles.get(&profile).expect("must be present"); | ||
|
||
settings | ||
cache.profiles.get(&profile).expect("must be present") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clippy lint rule now enforces returning the result of a
let binding from a block
preferring direct returns where possible
@@ -514,7 +514,7 @@ impl<'a> InvariantExecutor<'a> { | |||
invariant_contract: &InvariantContract<'_>, | |||
fuzz_fixtures: &FuzzFixtures, | |||
deployed_libs: &[Address], | |||
) -> Result<(InvariantTest, impl Strategy<Value = BasicTxDetails>)> { | |||
) -> Result<(InvariantTest, impl Strategy<Value = BasicTxDetails> + use<>)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ use<>
stems from https://rust-lang.github.io/rfcs/3617-precise-capturing.html, now required
Motivation
Closes: #10734
Solution
Initial commit was done as a trial run with Claude, worked quite well!
Some of the added
.clone()
is concerning, will look for alternative solution to deal with ownership. We are mostly dealing withArc
's and the other fields are likely light to clone.Expecting this PR to fail its lint check, doing that in a follow-up here: #10803 as the diff is very large in terms of number of files touched
PR Checklist