]>
Commit | Line | Data |
---|---|---|
9ffffee4 | 1 | // Regression test for #69409 |
74b04a01 XL |
2 | |
3 | struct Cat { | |
4 | meows : usize, | |
5 | how_hungry : isize, | |
6 | } | |
7 | ||
8 | impl Cat { | |
9 | pub fn speak(&self) { self.meows += 1; } | |
10 | } | |
11 | ||
12 | fn cat(in_x : usize, in_y : isize) -> Cat { | |
13 | Cat { | |
14 | meows: in_x, | |
15 | how_hungry: in_y | |
16 | } | |
17 | } | |
18 | ||
19 | fn main() { | |
20 | let nyan : Cat = cat(52, 99); | |
21 | nyan.speak = || println!("meow"); //~ ERROR attempted to take value of method | |
22 | nyan.speak += || println!("meow"); //~ ERROR attempted to take value of method | |
23 | } |