Skip to content

Commit

Permalink
Revert MSRV to 1.48 (#87)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
  • Loading branch information
ia0 and sdroege authored Nov 12, 2023
1 parent fa533bd commit d137ca1
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 48 deletions.
108 changes: 66 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,37 +211,49 @@ jobs:
- name: cd lib/macro && cargo +stable semver-checks check-release
run: cargo +stable semver-checks check-release
working-directory: lib/macro
- run: rustup install 1.70
- name: cd lib && cargo +1.70 build
run: cargo +1.70 build
- run: rustup install 1.48
- run: cd lib && mv Cargo.lock Cargo.lock.backup
- run: cd lib && cp Cargo.lock.msrv Cargo.lock
- name: cd lib && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib
- name: cd lib && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib
- name: cd lib && cargo +1.70 build --no-default-features --features=alloc
run: cargo +1.70 build --no-default-features --features=alloc
- name: cd lib && cargo +1.48 build --no-default-features --features=alloc
run: cargo +1.48 build --no-default-features --features=alloc
working-directory: lib
- name: cd lib && cargo +1.70 build --release --no-default-features --features=alloc
run: cargo +1.70 build --release --no-default-features --features=alloc
- name: cd lib && cargo +1.48 build --release --no-default-features --features=alloc
run: cargo +1.48 build --release --no-default-features --features=alloc
working-directory: lib
- name: cd lib && cargo +1.70 build --no-default-features
run: cargo +1.70 build --no-default-features
- name: cd lib && cargo +1.48 build --no-default-features
run: cargo +1.48 build --no-default-features
working-directory: lib
- name: cd lib && cargo +1.70 build --release --no-default-features
run: cargo +1.70 build --release --no-default-features
- name: cd lib && cargo +1.48 build --release --no-default-features
run: cargo +1.48 build --release --no-default-features
working-directory: lib
- name: cd lib/macro/internal && cargo +1.70 build
run: cargo +1.70 build
- run: cd lib && rm Cargo.lock
- run: cd lib && mv Cargo.lock.backup Cargo.lock
- run: cd lib/macro/internal && mv Cargo.lock Cargo.lock.backup
- run: cd lib/macro/internal && cp Cargo.lock.msrv Cargo.lock
- name: cd lib/macro/internal && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib/macro/internal
- name: cd lib/macro/internal && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib/macro/internal && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib/macro/internal
- name: cd lib/macro && cargo +1.70 build
run: cargo +1.70 build
- run: cd lib/macro/internal && rm Cargo.lock
- run: cd lib/macro/internal && mv Cargo.lock.backup Cargo.lock
- run: cd lib/macro && mv Cargo.lock Cargo.lock.backup
- run: cd lib/macro && cp Cargo.lock.msrv Cargo.lock
- name: cd lib/macro && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib/macro
- name: cd lib/macro && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib/macro && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib/macro
- run: cd lib/macro && rm Cargo.lock
- run: cd lib/macro && mv Cargo.lock.backup Cargo.lock
windows:
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -320,34 +332,46 @@ jobs:
- name: cd bin && cargo +stable build --release
run: cargo +stable build --release
working-directory: bin
- run: rustup install 1.70
- name: cd lib && cargo +1.70 build
run: cargo +1.70 build
- run: rustup install 1.48
- run: cd lib && mv Cargo.lock Cargo.lock.backup
- run: cd lib && cp Cargo.lock.msrv Cargo.lock
- name: cd lib && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib
- name: cd lib && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib
- name: cd lib && cargo +1.70 build --no-default-features --features=alloc
run: cargo +1.70 build --no-default-features --features=alloc
- name: cd lib && cargo +1.48 build --no-default-features --features=alloc
run: cargo +1.48 build --no-default-features --features=alloc
working-directory: lib
- name: cd lib && cargo +1.70 build --release --no-default-features --features=alloc
run: cargo +1.70 build --release --no-default-features --features=alloc
- name: cd lib && cargo +1.48 build --release --no-default-features --features=alloc
run: cargo +1.48 build --release --no-default-features --features=alloc
working-directory: lib
- name: cd lib && cargo +1.70 build --no-default-features
run: cargo +1.70 build --no-default-features
- name: cd lib && cargo +1.48 build --no-default-features
run: cargo +1.48 build --no-default-features
working-directory: lib
- name: cd lib && cargo +1.70 build --release --no-default-features
run: cargo +1.70 build --release --no-default-features
- name: cd lib && cargo +1.48 build --release --no-default-features
run: cargo +1.48 build --release --no-default-features
working-directory: lib
- name: cd lib/macro/internal && cargo +1.70 build
run: cargo +1.70 build
- run: cd lib && rm Cargo.lock
- run: cd lib && mv Cargo.lock.backup Cargo.lock
- run: cd lib/macro/internal && mv Cargo.lock Cargo.lock.backup
- run: cd lib/macro/internal && cp Cargo.lock.msrv Cargo.lock
- name: cd lib/macro/internal && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib/macro/internal
- name: cd lib/macro/internal && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib/macro/internal && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib/macro/internal
- name: cd lib/macro && cargo +1.70 build
run: cargo +1.70 build
- run: cd lib/macro/internal && rm Cargo.lock
- run: cd lib/macro/internal && mv Cargo.lock.backup Cargo.lock
- run: cd lib/macro && mv Cargo.lock Cargo.lock.backup
- run: cd lib/macro && cp Cargo.lock.msrv Cargo.lock
- name: cd lib/macro && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib/macro
- name: cd lib/macro && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib/macro && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib/macro
- run: cd lib/macro && rm Cargo.lock
- run: cd lib/macro && mv Cargo.lock.backup Cargo.lock
2 changes: 1 addition & 1 deletion lib/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Minor

- Make some functions `must_use`
- Bump MSRV from 1.47 to 1.70
- Bump MSRV from 1.47 to 1.48

### Patch

Expand Down
5 changes: 5 additions & 0 deletions lib/Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions lib/macro/Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions lib/macro/internal/Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,17 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
// TODO: This list up to warn(clippy::pedantic) should ideally use a lint group.
#![warn(elided_lifetimes_in_paths)]
#![warn(let_underscore_drop)]
// TODO(msrv): #![warn(let_underscore_drop)]
#![warn(missing_debug_implementations)]
#![warn(missing_docs)]
#![warn(unreachable_pub)]
#![warn(unsafe_op_in_unsafe_fn)]
// TODO(msrv): #![warn(unsafe_op_in_unsafe_fn)]
#![warn(unused_results)]
#![allow(unused_unsafe)] // TODO(msrv)
#![warn(clippy::pedantic)]
#![allow(clippy::enum_glob_use)]
#![allow(clippy::similar_names)]
#![allow(clippy::uninlined_format_args)] // TODO(msrv)

#[cfg(feature = "alloc")]
extern crate alloc;
Expand Down Expand Up @@ -304,7 +306,7 @@ impl core::fmt::Display for DecodeKind {
DecodeKind::Trailing => "non-zero trailing bits",
DecodeKind::Padding => "invalid padding length",
};
write!(f, "{description}")
write!(f, "{}", description)
}
}

Expand Down Expand Up @@ -1565,7 +1567,7 @@ impl core::fmt::Display for SpecificationError {
Duplicate(c) => write!(f, "{:?} has conflicting definitions", c as char),
ExtraPadding => write!(f, "unnecessary padding"),
WrapLength => write!(f, "invalid wrap width or separator length"),
WrapWidth(x) => write!(f, "wrap width not a multiple of {x}"),
WrapWidth(x) => write!(f, "wrap width not a multiple of {}", x),
FromTo => write!(f, "translate from/to length mismatch"),
Undefined(c) => write!(f, "{:?} is undefined", c as char),
}
Expand Down
23 changes: 22 additions & 1 deletion xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ enum Toolchain {
#[strum(serialize = "stable")]
Stable,

#[strum(serialize = "1.70")]
#[strum(serialize = "1.48")]
Msrv,
}

Expand Down Expand Up @@ -164,6 +164,18 @@ impl Action {
args: vec![format!("+{}", self.toolchain)],
};
}
if self.toolchain == Toolchain::Msrv {
let lock = "Cargo.lock";
let backup = "Cargo.lock.backup";
let msrv = "Cargo.lock.msrv";
// We assume a lock file already exists, which should often by the case.
instructions += Instruction::shell("mv", &[lock, backup]);
instructions += Instruction::shell("cp", &[msrv, lock]);
instructions.0.rotate_right(2);
// We have to remove first because Windows cannot move on an existing file.
instructions += Instruction::shell("rm", &[lock]);
instructions += Instruction::shell("mv", &[backup, lock]);
}
instructions
}
}
Expand All @@ -183,6 +195,15 @@ struct Instruction {
}

impl Instruction {
fn shell(cmd: &str, args: &[&str]) -> Self {
Instruction {
executor: Executor::Shell,
env: vec![],
cmd: cmd.to_string(),
args: args.iter().map(|x| x.to_string()).collect(),
}
}

fn execute(&self, toolchain: Toolchain, dir: Dir) {
let mut command = match self.executor {
Executor::Cargo => {
Expand Down

0 comments on commit d137ca1

Please sign in to comment.