Skip to content

Commit a1ce2b4

Browse files
authored
chore: bump MSRV to 1.83 (#230)
1 parent 9589a49 commit a1ce2b4

File tree

14 files changed

+27
-29
lines changed

14 files changed

+27
-29
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
24-
rust: ["stable", "1.70"]
24+
rust: ["stable", "1.83"]
2525
flags: ["", "--all-features"]
2626
exclude:
2727
# Skip because some features have higher MSRV.
28-
- rust: "1.70" # MSRV
28+
- rust: "1.83" # MSRV
2929
flags: "--all-features"
3030
steps:
3131
- uses: actions/checkout@v4
32-
- uses: dtolnay/rust-toolchain@stable
32+
- uses: dtolnay/rust-toolchain@master
33+
with:
34+
toolchain: ${{ matrix.rust }}
3335
- name: Install test binaries
3436
shell: bash
3537
run: ./.github/scripts/install_test_binaries.sh
@@ -38,11 +40,7 @@ jobs:
3840
- uses: Swatinem/rust-cache@v2
3941
with:
4042
cache-on-failure: true
41-
- name: build
42-
if: matrix.rust == '1.70' # MSRV
43-
run: cargo build --workspace ${{ matrix.flags }}
4443
- name: test
45-
if: matrix.rust != '1.70' # MSRV
4644
shell: bash
4745
run: cargo nextest run ${{ matrix.flags }} --retries 2
4846

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resolver = "2"
55
[workspace.package]
66
authors = ["Foundry Maintainers"]
77
version = "0.12.3"
8-
rust-version = "1.70"
8+
rust-version = "1.83"
99
readme = "README.md"
1010
license = "MIT OR Apache-2.0"
1111
repository = "https://github.com/foundry-rs/compilers"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ When updating this, also update:
2626

2727
Foundry Compilers will keep a rolling MSRV (minimum supported rust version) policy of **at
2828
least** 6 months. When increasing the MSRV, the new Rust version must have been
29-
released at least six months ago. The current MSRV is 1.70.0.
29+
released at least six months ago. The current MSRV is 1.83.0.
3030

3131
Note that the MSRV is not increased automatically, and only as part of a minor
3232
release.

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
msrv = "1.70"
1+
msrv = "1.83"

crates/artifacts/solc/src/error.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,11 @@ impl fmt::Display for Error {
150150
// unless it also contains a source location, in which case the entire error message is an
151151
// old style error message, like:
152152
// path/to/file:line:column: ErrorType: message
153-
if lines.clone().next().map_or(false, |l| {
154-
l.contains(short_msg) && l.bytes().filter(|b| *b == b':').count() < 3
155-
}) {
153+
if lines
154+
.clone()
155+
.next()
156+
.is_some_and(|l| l.contains(short_msg) && l.bytes().filter(|b| *b == b':').count() < 3)
157+
{
156158
let _ = lines.next();
157159
}
158160

crates/artifacts/solc/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ impl SolcInput {
110110
let mut yul_sources = Sources::new();
111111

112112
for (file, source) in sources {
113-
if file.extension().map_or(false, |e| e == "yul") {
113+
if file.extension().is_some_and(|e| e == "yul") {
114114
yul_sources.insert(file, source);
115-
} else if file.extension().map_or(false, |e| e == "sol") {
115+
} else if file.extension().is_some_and(|e| e == "sol") {
116116
solidity_sources.insert(file, source);
117117
}
118118
}

crates/artifacts/solc/src/output_selection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ impl OutputSelection {
149149
/// TODO: correctly process wildcard keys to reduce false negatives
150150
pub fn is_subset_of(&self, other: &Self) -> bool {
151151
self.0.iter().all(|(file, selection)| {
152-
other.0.get(file).map_or(false, |other_selection| {
152+
other.0.get(file).is_some_and(|other_selection| {
153153
selection.iter().all(|(contract, outputs)| {
154-
other_selection.get(contract).map_or(false, |other_outputs| {
154+
other_selection.get(contract).is_some_and(|other_outputs| {
155155
outputs.iter().all(|output| other_outputs.contains(output))
156156
})
157157
})

crates/artifacts/vyper/src/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl VyperInput {
2222
let mut interfaces = Sources::new();
2323

2424
for (path, content) in sources {
25-
if path.extension().map_or(false, |ext| ext == VYPER_INTERFACE_EXTENSION) {
25+
if path.extension().is_some_and(|ext| ext == VYPER_INTERFACE_EXTENSION) {
2626
// Interface .vyi files should be removed from the output selection.
2727
settings.output_selection.0.remove(path.to_string_lossy().as_ref());
2828
interfaces.insert(path, content);

crates/compilers/src/cache.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ impl GroupedSources {
616616

617617
/// Returns true if the file was included with the given version.
618618
pub fn contains(&self, file: &Path, version: &Version) -> bool {
619-
self.inner.get(file).map_or(false, |versions| versions.contains(version))
619+
self.inner.get(file).is_some_and(|versions| versions.contains(version))
620620
}
621621
}
622622

@@ -783,9 +783,7 @@ impl<T: ArtifactOutput, C: Compiler> ArtifactsCacheInner<'_, T, C> {
783783

784784
let mut dirty_profiles = HashSet::new();
785785
for (profile, settings) in &self.cache.profiles {
786-
if !existing_profiles
787-
.get(profile.as_str())
788-
.map_or(false, |p| p.can_use_cached(settings))
786+
if !existing_profiles.get(profile.as_str()).is_some_and(|p| p.can_use_cached(settings))
789787
{
790788
trace!("dirty profile: {}", profile);
791789
dirty_profiles.insert(profile.clone());

crates/compilers/src/compile/output/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ impl<C: Compiler> AggregatedCompilerOutput<C> {
872872

873873
self.contracts.contracts_with_files().filter(|(path, _, _)| *path == contract_path).any(
874874
|(_, _, contract)| {
875-
contract.abi.as_ref().map_or(false, |abi| abi.functions.contains_key("IS_TEST"))
875+
contract.abi.as_ref().is_some_and(|abi| abi.functions.contains_key("IS_TEST"))
876876
},
877877
)
878878
}

0 commit comments

Comments
 (0)