-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
nightly regression?: dead_code
detection with -Zfuture-incompat-test
#114804
Comments
cc @Urgau, as it looks like you made the change. Sorry I don't really understand rustc internals. Can't help here. |
To reproduce:
Output:
It only happend with |
Thanks you for the ping and the reproducer. ❤️ Before #114710, the #[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
#[allow(dead_code)]
fn main() { }
#[rustc_main]
#[no_coverage]
fn main()
->
() {
extern crate test;
test::test_main_static(&[])
} but
so For the purpose of @rustbot label +requires-nightly -needs-triage |
Switch to an empty `lib.rs` from `main.rs`. See rust-lang/rust#114804 (comment)
Switch to an empty `lib.rs` from `main.rs`. See rust-lang/rust#114804 (comment)
Code
Test against rust-lang/cargo@7e9de3f with the current nightly.
Expected warning from Cargo v.s Actual
Note that the primary package
foo
is included because nightly compiler starts reportingmain()
as a dead code in conjunction with-Zfuture-incompat-test
, which it used to display dependencies only.And yes in Cargo we use
-Zfuture-incompat-test
to fire a future-incompat warning for tests. This doesn't work anymore. See https://github.com/rust-lang/cargo/actions/runs/5850845391/job/15860819020?pr=12489Version it worked on
searched nightlies: from nightly-2023-08-01 to nightly-2023-08-14
regressed nightly: nightly-2023-08-13
searched commit range: a6f8aa5...28eb857
regressed commit: 1e836d1
regressed PR: #114710
bisected with cargo-bisect-rustc v0.6.6
Host triple: aarch64-apple-darwin
Reproduce with:
cargo bisect-rustc --start 2023-08-01 --end 2023-08-14 -- test --test testsuite test_multi_crate
The versions of Cargo in
nightly-2023-08-12
andnightly-2023-08-13
are the same, but only 08-13 regressed. Hence, I excluded Cargo as a source of this regression. I'll continue investigating but any help is pretty much welcome!Not a proposed solution
Taking out the insertion from the if block works, though I believe it is not the correct way to solve this.
The text was updated successfully, but these errors were encountered: