Skip to content

Commit

Permalink
Auto merge of #13455 - surechen:for_rustc_117772, r=weihanglo
Browse files Browse the repository at this point in the history
Remove unnecessary `use` statement in metabuild

Check this situation in PR [#117772](rust-lang/rust#117772)  in rustc.

This blocks the merge of that PR. Details in [CI log](https://github.com/rust-lang-ci/rust/actions/runs/7886502990/job/21519873414).

```bash
2024-02-13T13:22:45.9857459Z failures:
2024-02-13T13:22:45.9857706Z
2024-02-13T13:22:45.9858644Z ---- metabuild::metabuild_fresh stdout ----
2024-02-13T13:22:45.9881590Z running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo check -vv`
2024-02-13T13:22:45.9883611Z running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo check -vv`
2024-02-13T13:22:45.9884693Z thread 'metabuild::metabuild_fresh' panicked at tests/testsuite/metabuild.rs:284:10:
2024-02-13T13:22:45.9885493Z �[1m�[31merror�[0m�[1m:�[0m test failed, to rerun pass `--test testsuite`
2024-02-13T13:22:45.9885887Z
2024-02-13T13:22:45.9886990Z test failed running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo check -vv`
2024-02-13T13:22:45.9888275Z error: stderr did not match:
2024-02-13T13:22:45.9888777Z 1   1            Fresh mb [..]
2024-02-13T13:22:45.9889189Z     2    +warning: the item `mb` is imported redundantly
2024-02-13T13:22:45.9889820Z     3    + --> target/.metabuild/metabuild-foo-0e2ce73c8cda338a.rs:1:5
2024-02-13T13:22:45.9890297Z     4    +  |
2024-02-13T13:22:45.9890545Z     5    +1 | use mb;
2024-02-13T13:22:45.9890899Z     6    +  |     ^^ the item `mb` is already defined here
2024-02-13T13:22:45.9891299Z     7    +  |
2024-02-13T13:22:45.9891623Z     8    +  = note: `#[warn(unused_imports)]` on by default
2024-02-13T13:22:45.9927602Z     9    +
2024-02-13T13:22:45.9928248Z     10   +warning: `foo` (build script) generated 1 warning
2024-02-13T13:22:45.9930583Z 2   11           Fresh foo [..]
2024-02-13T13:22:45.9931176Z 3   12        Finished `dev` profile [..]
2024-02-13T13:22:45.9931653Z
2024-02-13T13:22:45.9931665Z
2024-02-13T13:22:45.9932104Z other output:
2024-02-13T13:22:45.9932291Z
2024-02-13T13:22:45.9932297Z
2024-02-13T13:22:45.9932309Z
2024-02-13T13:22:45.9932316Z
2024-02-13T13:22:45.9932417Z failures:
2024-02-13T13:22:45.9932695Z     metabuild::metabuild_fresh

```
  • Loading branch information
bors authored and ehuss committed Feb 28, 2024
1 parent e4842f2 commit 6014cef
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/cargo/core/compiler/custom_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,9 +1074,6 @@ fn prepare_metabuild(cx: &Context<'_, '_>, unit: &Unit, deps: &[String]) -> Carg
.map(|d| d.unit.target.crate_name())
})
.collect();
for dep in &meta_deps {
output.push(format!("use {};\n", dep));
}
output.push("fn main() {\n".to_string());
for dep in &meta_deps {
output.push(format!(" {}::metabuild();\n", dep));
Expand Down

0 comments on commit 6014cef

Please sign in to comment.