Compiling playground v0.0.1 (/playground)
warning: any use of this value will cause an error
--> src/main.rs:4:24
|
4 | const ASSERT: () = [()][(std::mem::size_of::<Self>() != 0) as usize];
| -------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| index out of bounds: the len is 1 but the index is 1
|
note: the lint level is defined here
--> src/main.rs:1:8
|
1 | #[warn(const_err)]
| ^^^^^^^^^
error: erroneous constant encountered
--> src/main.rs:12:9
|
12 | T::ASSERT
| ^^^^^^^^^
error: aborting due to previous error; 1 warning emitted
error: could not compile `playground`.
To learn more, run the command again with --verbose.
The following code does not highlight the
foo::<u32>()
call, even though removing it will remove the error.(Playground)
Errors: