-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Some errors only show up with cargo build
not cargo check
#70923
Comments
Or maybe it is a bad idea to emit lints during optimization, and we should move the lints from const-prop to elsewhere? |
the reason the lints are part of const prop is to ensure we don't do the work twice, once for linting and once for the const prop optimization. I'm not sure how we could do that differently. Also I was envisioning adding more lints to the optimization pipeline instead of the other way around. |
Do we have a concrete example / test case demonstrating this? |
This comment has been minimized.
This comment has been minimized.
@ehuss has an example of this: it passes with fn main() {
let a: u8 = 42;
let b = ((a | 0x0F) - 1) >> 31 > 0;
println!("{}", b);
} |
This is partially due to the fact that our
analysis
queryrust/src/librustc_interface/passes.rs
Line 775 in 537ccdf
optimized_mir
query on all items in the current crate, and also because we don't run monomorphization when building bin crates.optimized_mir
query inanalysis
cargo check
because we'd be doing optimizations nowoptimized_mir
, but we may add more in the future.optimized_mir
cc @Centril
The text was updated successfully, but these errors were encountered: