( )⚙ D10085 copies-rust: remove an unnecessary format!() inside assert!()

This is an archive of the discontinued Mercurial Phabricator instance.

copies-rust: remove an unnecessary format!() inside assert!()
ClosedPublic

Authored by martinvonz on Mar 1 2021, 5:49 PM.

Details

Summary

The assert!() macro supports formatting. Rust 2021 no longer
supports an unnecessary format!() inside it. I noticed because I
recently update my Rust toolchain and test-check-cargo-lock.t
started failing.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

martinvonz created this revision.Mar 1 2021, 5:49 PM
SimonSapin accepted this revision.Mar 2 2021, 2:25 AM

I recently update my Rust toolchain and test-check-cargo-lock.t started failing.

If most of Cargo.lock was rewritten this is likely that the file was upgraded to the newer format: https://blog.rust-lang.org/2020/01/30/Rust-1.41.0.html#less-conflict-prone-cargolock-format. Lately I’ve been reverting that change with hg revert rust/Cargo.lock && (cd rust && cargo +1.41.1 fetch) which Cargo does automatically every time I change a Cargo.toml file such as to add a dependency.

But looking up this blog post I see that support for this new format was introduced in 1.40.0. Since the oldest version we support is 1.41.1 (for Debian) maybe we should just do the upgrade.

Alphare accepted this revision.Mar 2 2021, 3:39 AM
Alphare added a subscriber: Alphare.

But looking up this blog post I see that support for this new format was introduced in 1.40.0. Since the oldest version we support is 1.41.1 (for Debian) maybe we should just do the upgrade.

Agreed

pulkit accepted this revision.Mar 2 2021, 4:02 AM
This revision is now accepted and ready to land.Mar 2 2021, 4:02 AM

I recently update my Rust toolchain and test-check-cargo-lock.t started failing.

If most of Cargo.lock was rewritten

Nope, I think it was just that the compiler started issuing a warning and that warning showed up when running the test