Skip to content

Commit

Permalink
Rollup merge of #103781 - JakobDegen:mir-opt-tidy, r=jyn514
Browse files Browse the repository at this point in the history
Detect unused files in `src/test/mir-opt` and error on them in tidy.

Closes #97564 .

Determining which files are generated by a given mir opt test is somewhat difficult. Because of this, we extract the logic for doing it out into a common crate that both compiletest and tidy can depend on. This avoids making compiletest a dependency of tidy which would negatively impact compile times for tidy.

Testing for this is that it catches 5 files that violated this lint (and removes them).
  • Loading branch information
Manishearth committed Nov 2, 2022
2 parents 2cfab1f + 17395b4 commit e2a6d28
Show file tree
Hide file tree
Showing 17 changed files with 168 additions and 496 deletions.
9 changes: 9 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ dependencies = [
"lazycell",
"libc",
"miow",
"miropt-test-tools",
"regex",
"rustfix",
"serde",
Expand Down Expand Up @@ -2268,6 +2269,13 @@ dependencies = [
"ui_test",
]

[[package]]
name = "miropt-test-tools"
version = "0.1.0"
dependencies = [
"regex",
]

[[package]]
name = "new_debug_unreachable"
version = "1.0.4"
Expand Down Expand Up @@ -4920,6 +4928,7 @@ version = "0.1.0"
dependencies = [
"cargo_metadata 0.14.0",
"lazy_static",
"miropt-test-tools",
"regex",
"walkdir",
]
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"src/tools/error_index_generator",
"src/tools/linkchecker",
"src/tools/lint-docs",
"src/tools/miropt-test-tools",
"src/tools/rustbook",
"src/tools/unstable-book-gen",
"src/tools/tidy",
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ impl<'a> Builder<'a> {
check::Clippy,
check::Miri,
check::CargoMiri,
check::MiroptTestTools,
check::Rls,
check::RustAnalyzer,
check::Rustfmt,
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ tool_check_step!(Miri, "src/tools/miri", SourceType::InTree);
tool_check_step!(CargoMiri, "src/tools/miri/cargo-miri", SourceType::InTree);
tool_check_step!(Rls, "src/tools/rls", SourceType::InTree);
tool_check_step!(Rustfmt, "src/tools/rustfmt", SourceType::InTree);
tool_check_step!(MiroptTestTools, "src/tools/miropt-test-tools", SourceType::InTree);

tool_check_step!(Bootstrap, "src/bootstrap", SourceType::InTree, false);

Expand Down
72 changes: 0 additions & 72 deletions src/test/mir-opt/rustc.try_identity.DestinationPropagation.diff

This file was deleted.

106 changes: 0 additions & 106 deletions src/test/mir-opt/simplify_try.try_identity.DestinationPropagation.diff

This file was deleted.

This file was deleted.

Loading

0 comments on commit e2a6d28

Please sign in to comment.