]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/traits/trait-coercion-generic.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / traits / trait-coercion-generic.rs
diff --git a/src/test/ui/traits/trait-coercion-generic.rs b/src/test/ui/traits/trait-coercion-generic.rs
deleted file mode 100644 (file)
index bf4dda4..0000000
+++ /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");
-}