]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-14399.rs
Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
[rust.git] / src / test / 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 }