]> git.proxmox.com Git - rustc.git/blob - tests/ui/issues/issue-14399.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / issues / issue-14399.rs
1 // run-pass
2 // #14399
3 // We'd previously ICE if we had a method call whose return
4 // value was coerced to a trait object. (v.clone() returns Box<B1>
5 // which is coerced to Box<A>).
6
7 // pretty-expanded FIXME #23616
8
9 #[derive(Clone)]
10 struct B1;
11
12 trait A { fn foo(&self) {} }
13 impl A for B1 {}
14
15 fn main() {
16 let v: Box<_> = Box::new(B1);
17 let _c: Box<dyn A> = v.clone();
18 }