Skip to content
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

Overwriting "-Aunused" does not work any more #216

Closed
RalfJung opened this issue Apr 5, 2020 · 3 comments · Fixed by #217
Closed

Overwriting "-Aunused" does not work any more #216

RalfJung opened this issue Apr 5, 2020 · 3 comments · Fixed by #217

Comments

@RalfJung
Copy link
Contributor

RalfJung commented Apr 5, 2020

In Miri, we'd like tests to fail when they contain unused code (as that usually indicates a bug in the test). To achieve this, I have set target_rustcflags to contain -Dwarnings -Dunused. I am pretty sure that when I introduced this (years ago), it worked fine.

However, by pure accident, I just noticed that this does not work any more, and a test with a dead_code warning passes. Now I am worried we might have plenty of bugs in our test suite that got missed due to this. I tried strengthening the flags to include -Fwarnings -Funused -Fdead_code, to no avail.

@RalfJung
Copy link
Contributor Author

RalfJung commented Apr 5, 2020

Maybe the order in which the compiletest-enforced and the custom flags are added changed? -Aunused -Funused works as intended, but -Funused -Aunused does not raise any errors (which seems like a rustc bug to me, but that is orthogonal).

@RalfJung
Copy link
Contributor Author

RalfJung commented Apr 5, 2020

Possibly the change in behavior is caused by a rustc change: rust-lang/rust#70819

However, independently of that it would be good if there was a way for compiletest not to add its own flags to the rustc invocation.

@RalfJung
Copy link
Contributor Author

RalfJung commented Apr 5, 2020

In rust-lang/rust#67885, the rustc version of compiletest gained a flag to control adding -A unused.

Centril added a commit to Centril/rust that referenced this issue Apr 10, 2020
…Simulacrum

compiletest: let config flags overwrite -A unused

Cc Manishearth/compiletest-rs#216
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant