blob: 67af899fdffa098baa5c687eb11145a057f2e516 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
trait Hello {
fn example(val: ());
}
struct Test1(i32);
impl Hello for Test1 {
fn example(&self, input: &i32) {
//~^ ERROR `&self` declaration in the impl, but not in the trait
*input = self.0;
//~^ ERROR cannot assign to `*input`, which is behind a `&` reference
}
}
fn main() {}
|