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
When running "cargo test" on this code (reproducable for me when checking out the compiler_bug branch). The compiler outputs:
Compiling SFCodec v0.1.0 (file:///home/kevin/Projects/Rust/SFCodec)
<std macros>:5:4: 84:20 error: mismatched types:
expected `bool`,
found `u8`
(expected bool,
found u8) [E0308]
(internal compiler error: unprintable span)
src/utils.rs:84:9: 84:57 note: in this expansion of assert! (defined in <std macros>)
<std macros>:5:4: 84:20 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
Could not compile `SFCodec`.
To learn more, run the command again with --verbose.
This is the corresponding code snipped:
fn test_byte_and_back() {
extern crate rand;
use self::rand::{thread_rng, Rng};
let mut rng = thread_rng();
for i in 0..20 {
let mut num:u8 = 0;
for i in 0..8 {
num = rng.gen();
}
assert!(num, bools_to_byte(byte_to_bools(num))); //line 84
}
}
I get the following. This isn't an ICE, so I'm going to go ahead and close. Please reopen if there's actually something wrong here!
error[E0308]: mismatched types
--> src/utils.rs:84:9
|
84 | assert!(num, bools_to_byte(byte_to_bools(num)));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found u8
|
= note: this error originates in a macro outside of the current crate
When running "cargo test" on this code (reproducable for me when checking out the compiler_bug branch). The compiler outputs:
This is the corresponding code snipped:
rustc --version --verbose:
The text was updated successfully, but these errors were encountered: