Closed
Description
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=5c971999babd48f6d0b57e56450996f2
#![feature(generic_const_exprs)]
trait True {}
struct Is<const V: bool>;
impl True for Is<true> {}
fn g<T>()
where Is<{ std::mem::size_of::<T>() == 0 }>: True
{ }
fn main() {
g::<usize>();
}
The current output is:
error[[E0308]](https://doc.rust-lang.org/nightly/error-index.html#E0308): mismatched types
--> src/main.rs:14:5
|
14 | g::<usize>();
| ^^^^^^^^^^ expected `false`, found `true`
|
= note: expected type `false`
found type `true`
For more information about this error, try `rustc --explain E0308`.
Due to something true
and false
are considered types, not values, also the error span is not any informative.