summary refs log tree commit diff
path: root/src/test/ui/error-codes/E0033-teach.rs
blob: 0f0b8d864dc43c15d9df99d69c13de35bc8ba402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// compile-flags: -Z teach

trait SomeTrait {
    fn foo();
}

fn main() {
    let trait_obj: &SomeTrait = SomeTrait;
    //~^ ERROR expected value, found trait `SomeTrait`
    //~| ERROR E0038
    //~| method `foo` has no receiver

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