rust/tests/ui/traits/next-solver/upcast-wrong-substs.rs
2024-02-16 20:02:50 +00:00

12 lines
195 B
Rust

//@ compile-flags: -Znext-solver
trait Foo: Bar<i32> + Bar<u32> {}
trait Bar<T> {}
fn main() {
let x: &dyn Foo = todo!();
let y: &dyn Bar<usize> = x;
//~^ ERROR mismatched types
}