rust/tests/ui/traits/new-solver/upcast-wrong-substs.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
230 B
Rust
Raw Normal View History

2023-01-23 23:56:54 +00:00
// compile-flags: -Ztrait-solver=next
#![feature(trait_upcasting)]
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
}