mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 10:18:25 +00:00
21 lines
296 B
Rust
21 lines
296 B
Rust
//@ check-fail
|
|
|
|
trait Bar<T> {
|
|
fn bar(&self, _: T) {}
|
|
}
|
|
|
|
trait Foo: Bar<i32> + Bar<u32> {
|
|
fn foo(&self, _: ()) {}
|
|
}
|
|
|
|
struct S;
|
|
|
|
impl Bar<i32> for S {}
|
|
impl Bar<u32> for S {}
|
|
impl Foo for S {}
|
|
|
|
fn main() {
|
|
let s: &dyn Foo = &S;
|
|
let t: &dyn Bar<_> = s; //~ ERROR mismatched types
|
|
}
|