Skip to content

Conversation

@brannondorsey
Copy link
Contributor

Completes the task originally discussed in #1806.

Update the root Cargo.lock file to remove if_chain dependency
references after the crate was removed from the workspace.
@brannondorsey
Copy link
Contributor Author

@smoelius I'm curious if you have a recommended fix for the failing build as of f924fdc.

Originally I tried to fix it with a86f6b8, but that was pretty naive.

The problem as I understand it is that some of the nightly toolchains in use in this project are old enough that they require feature(let_chains) while others are new enough that they forbid you from using it. 🙃

@smoelius
Copy link
Collaborator

smoelius commented Dec 5, 2025

Hey, @brannondorsey. I am currrently traveling, but I will try to look at this in the next couple of days.

@brannondorsey
Copy link
Contributor Author

No problem @smoelius. Safe travels!

Copy link
Collaborator

@smoelius smoelius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it took me longer than expected to get to this. Thanks again for working on this.

#![cfg_attr(dylint_lib = "general", allow(crate_wide_allow))]
#![cfg_attr(dylint_lib = "supplementary", allow(nonexistent_path_in_comment))]
#![cfg_attr(nightly, feature(rustc_private))]
#![cfg_attr(nightly, feature(let_chains))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#![cfg_attr(nightly, feature(let_chains))]

Please remove the above.

And please change the following line:

let rust_version = Version::parse(msrv::MSRV).unwrap();

to:

let rust_version = Version::parse(msrv::MSRV_PLUS_1).unwrap();

Let chains were stabilized in Rust 1.88.0. So I was confused as to why MSRV (=1.88.0) was not working. I think the reason is that MSRV_CHANNEL = nightly-2025-04-22 is when Clippy switched to version 0.1.88, not when Rust switched to 1.88.0. The latter occurred around 2025-06-23.

Anyway, when I test locally with MSRV_PLUS_1, it seems to work. Please tell me if your experience is different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've applied these suggested changes, however CI tests fail here with:

 error[E0658]: `let` expressions in this position are unstable
   --> /home/runner/work/dylint/dylint/internal/src/clippy_utils/revs_no_preinstall.rs:120:20
    |
120 |                 if let Some(prev_rev) = prev_rev
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
    = help: add `#![feature(let_chains)]` to the crate attributes to enable
    = note: this compiler was built on 2025-04-21; consider upgrading it if it is out of date

I think the reason is that the list::one_name_multiple_chains integration test relies on MSRV_CHANNEL (see here), which requires the let_chains feature.

You can reproduce this failing test in isolation with:

cargo test --package cargo-dylint --test integration one_name_multiple_toolchains

I previously tried to resolve this via a86f6b8 but that fails because of breaking clippy_utils changes changes on nightly.

I got a little scared off by that change. But revising it today, it looks like I can get that test to pass by bumping the MSRV nightly day by exactly one day, which resolves the error without introducing breaking API changes (see 307626d). 🥳

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This info log from rustup gives a hint as to why 307626d works...

Building dylint-template with channel `nightly-2025-04-22`
info: syncing channel updates for 'nightly-2025-04-22-aarch64-apple-darwin'
info: latest update on 2025-04-22, rust version 1.88.0-nightly (d6c1e454a 2025-04-21)

nightly-2025-04-22 actually uses a release built on 2025-04-21 (although confusingly, it does include 1.88- in the name).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK that resolves most of the errors and we're on to just one more failure.

https://github.com/trailofbits/dylint/actions/runs/20079593588/job/57602989209

Maybe we just need to bump MSRV_CLIPPY_UTILS_REV now?

@smoelius
Copy link
Collaborator

smoelius commented Dec 9, 2025

Let me please look at this some more.

This fixes the last::one_name_multiple_chains test
This one better matches the commit we're currently using in the trunk
branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants