diff options
Diffstat (limited to 'src/test/ui/traits/coercion-generic.rs')
-rw-r--r-- | src/test/ui/traits/coercion-generic.rs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/test/ui/traits/coercion-generic.rs b/src/test/ui/traits/coercion-generic.rs deleted file mode 100644 index bf4dda495..000000000 --- a/src/test/ui/traits/coercion-generic.rs +++ /dev/null @@ -1,25 +0,0 @@ -// run-pass -#![allow(dead_code)] -trait Trait<T> { - fn f(&self, x: T); -} - -#[derive(Copy, Clone)] -struct Struct { - x: isize, - y: isize, -} - -impl Trait<&'static str> for Struct { - fn f(&self, x: &'static str) { - println!("Hi, {}!", x); - } -} - -pub fn main() { - let a = Struct { x: 1, y: 2 }; - let b: Box<dyn Trait<&'static str>> = Box::new(a); - b.f("Mary"); - let c: &dyn Trait<&'static str> = &a; - c.f("Joe"); -} |