Skip to content

tests: ignore check_that_clippy_has_the_same_major_version_as_rustc()inside the rustc repo #6684

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
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
6 changes: 6 additions & 0 deletions tests/versioncheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ fn check_that_clippy_lints_has_the_same_version_as_clippy() {

#[test]
fn check_that_clippy_has_the_same_major_version_as_rustc() {
// do not run this test inside the upstream rustc repo:
// https://github.com/rust-lang/rust-clippy/issues/6683
if option_env!("RUSTC_TEST_SUITE").is_some() {
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't you just use cargo::is_rustc_test_suite() here? If not, just r=me.

Copy link
Member Author

@matthiaskrgr matthiaskrgr Feb 6, 2021

Choose a reason for hiding this comment

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

If I use mod cargo; to make the function available in versioncheck.rs, this would need #![feature(once_cell)] inside versioncheck.rs and causes a couple of unused warnings for CARGO_TARGET_DIR and TARGET_LIB which the test does not need.

Simply copying the function body was the most straightforward way that I saw.

return;
}

let clippy_version = rustc_tools_util::get_version_info!();
let clippy_major = clippy_version.major;
let clippy_minor = clippy_version.minor;
Expand Down