]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-14399.rs
Consider privacy more carefully when suggesting accessing fields
[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 #![feature(box_syntax)]
10
11 #[derive(Clone)]
12 struct B1;
13
14 trait A { fn foo(&self) {} }
15 impl A for B1 {}
16
17 fn main() {
18     let v: Box<_> = box B1;
19     let _c: Box<dyn A> = v.clone();
20 }