You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compile error due to the wrong literal data type #68951
I expected to see this happen: it should be compiled
Instead, this happened:
error[E0277]: no implementation for `u8 & i32`
--> src/main.rs:5:27
|
5 | let hi = (b >> 4) & 0xf;
| ^ no implementation for `u8 & i32`
|
= help: the trait `std::ops::BitAnd<i32>` is not implemented for `u8`
Compiling playground v0.0.1 (/playground)
error[E0277]: no implementation for `u8 & i32`
--> src/main.rs:5:27
|
5 | let hi = (b >> 4) & 0xf;
| ^ no implementation for `u8 & i32`
|
= help: the trait `std::ops::BitAnd<i32>` is not implemented for `u8`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground`.
To learn more, run the command again with --verbose.
Activity
pragmatrix commentedon Aug 26, 2020
Looks like this bug has been fixed in one of the recent Rust updates. Rust stable 1.45.2 compiles the code above without errors.
Rollup merge of rust-lang#77388 - JohnTitor:add-tests, r=Dylan-DPC
Rollup merge of rust-lang#77388 - JohnTitor:add-tests, r=Dylan-DPC