Skip to content

configuration option to lint incompatible_msrv in test code #14279

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 1 commit into from
Feb 28, 2025

Conversation

bryceberger
Copy link
Contributor

@bryceberger bryceberger commented Feb 22, 2025

fixes #14277

changelog: [incompatible_msrv]: add config option [check-incompatible-msrv-in-tests] to enable in #[test] and #[cfg(test)] code.

@rustbot
Copy link
Collaborator

rustbot commented Feb 22, 2025

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @blyxyas (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 22, 2025
@bryceberger bryceberger force-pushed the bryce/push-lnpmzsnstrzx branch 3 times, most recently from cb0c689 to 6aebfc1 Compare February 23, 2025 00:35
Copy link
Member

@blyxyas blyxyas left a comment

Choose a reason for hiding this comment

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

Could you add some tests? We test with different clippy.tomls at tests/ui-toml. You can add a new incompatible-msrv directory if it doesn't exist already, With a check-incompatible-msrv-in-tests = true in that tests/ui-toml/incompatible-msrv/clippy.toml and the following test flag for ui-toml/../<test filename>:

//@compile-flags --test

You can check the files in tests/ui-toml to gather some inspiration :)

@bryceberger bryceberger force-pushed the bryce/push-lnpmzsnstrzx branch from 6aebfc1 to 325bfef Compare February 26, 2025 00:54
@bryceberger bryceberger requested a review from blyxyas February 26, 2025 01:55
Copy link
Member

@blyxyas blyxyas left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! ❤️

//@compile-flags: --test
//@revisions: default enabled
//@[enabled] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/check_incompatible_msrv_in_tests/enabled
//@[default] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/check_incompatible_msrv_in_tests/default
Copy link
Member

Choose a reason for hiding this comment

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

Really smart to use several revisions instead of multiple subdirectories!

@blyxyas blyxyas added this pull request to the merge queue Feb 28, 2025
Merged via the queue into rust-lang:master with commit e1c1ac1 Feb 28, 2025
11 checks passed
@bryceberger bryceberger deleted the bryce/push-lnpmzsnstrzx branch February 28, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

incompatible_msrv false negative: tests
3 participants