2021-07-25 05:43:48 -05:00
|
|
|
// check-fail
|
|
|
|
#![feature(trait_upcasting)]
|
|
|
|
|
|
|
|
trait Bar<T> {
|
|
|
|
fn bar(&self, _: T) {}
|
|
|
|
}
|
|
|
|
|
2022-11-07 12:14:02 -06:00
|
|
|
trait Foo: Bar<i32> + Bar<u32> {
|
2021-07-25 05:43:48 -05:00
|
|
|
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
|
|
|
|
}
|