rust/tests/ui/traits/bound/on-structs-and-enums-static.rs
Gurinder Singh ace436743f Check that return type is WF in typeck
Without it non-WF types could pass typeck and then
later fail in MIR/const eval
2024-03-06 16:51:17 +05:30

17 lines
184 B
Rust

trait Trait {
fn dummy(&self) { }
}
struct Foo<T:Trait> {
x: T,
}
static X: Foo<usize> = Foo {
//~^ ERROR E0277
//~| ERROR E0277
x: 1, //~ ERROR: E0277
};
fn main() {
}