summaryrefslogtreecommitdiffstats
path: root/tests/ui/error-codes/E0033-teach.rs
blob: 289561bad8a0963a9b28a36b6b0334db00f72728 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// compile-flags: -Z teach
trait SomeTrait {
    fn foo(&self);
}
struct S;
impl SomeTrait for S {
    fn foo(&self) {}
}
fn main() {
    let trait_obj: &dyn SomeTrait = &S;

    let &invalid = trait_obj;
    //~^ ERROR E0033
}