no compilation error on impossible bitshift if not used #101763
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When creating a library that contains an impossible bitshift, e.g.
1u32 << 32
I expected to see this happen: the library doesn't compile.
Instead, this happened: the library compiles as long as the code is never used in the library but does fail to compile when used in another crate.
Other ways to fail compilation like
compile_error!
orlet a: u8 = -5
do stop the library from compiling even when the code is not in use.Meta
rustc version:
rustc 1.63.0 (4b91a6ea7 2022-08-08)
minimal repro: https://github.com/jonay2000/compile-error-bug
The text was updated successfully, but these errors were encountered: