Skip to content

Switch to the 2021 Rust edition #33

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

Merged
merged 2 commits into from
Jan 27, 2023
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
20 changes: 20 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ jobs:
- name: Run tests
run: rustup run stable cargo test --verbose

ubuntu_18_rust_msrv:
runs-on: ubuntu-18.04
env:
# sed -n 's/^rust-version = "\([0-9.]\+\)"$/\1/p' Cargo.toml
RUST_TOOLCHAIN: 1.63
steps:
- uses: actions/checkout@v3

- name: Install Rust MSRV
run: |
rm ~/.cargo/bin/{cargo-fmt,rustfmt} || :
rustup default ${{ env.RUST_TOOLCHAIN }}
rustup update ${{ env.RUST_TOOLCHAIN }}

- name: Build
run: rustup run ${{ env.RUST_TOOLCHAIN }} cargo build --verbose

- name: Build tests
run: rustup run ${{ env.RUST_TOOLCHAIN }} cargo build --tests --verbose

ubuntu_20_rust_stable:
runs-on: ubuntu-20.04
env:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = [
"Mickaël Salaün <mic@digikod.net>",
"Vincent Dagonneau <vincentdagonneau@gmail.com>"
]
edition = "2018"
edition = "2021"
rust-version = "1.63"
description = "Landlock LSM helpers"
homepage = "https://landlock.io"
Expand Down
4 changes: 2 additions & 2 deletions src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ lazy_static! {
if ABI::is_known(n) || n == 0 {
ABI::from(n)
} else {
panic!("Unknown ABI: {}", n);
panic!("Unknown ABI: {n}");
}
}
Err(std::env::VarError::NotPresent) => ABI::iter().last().unwrap(),
Err(e) => panic!("Failed to read LANDLOCK_CRATE_TEST_ABI: {}", e),
Err(e) => panic!("Failed to read LANDLOCK_CRATE_TEST_ABI: {e}"),
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ mod tests {
let ret = check(Ruleset::from(abi));

// Useful for failed tests and with cargo test -- --show-output
println!("Checking ABI {:?}, expecting {:#?}", abi, ret);
println!("Checking ABI {abi:?}, expecting {ret:#?}");
if can_emulate(abi, full) {
if abi < partial && error_if_abi_lt_partial {
// TODO: Check exact error type; this may require better error types.
Expand Down