-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
36 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// compile-flags: -Zsave-analysis | ||
// Also regression test for #69416 | ||
|
||
mod my_mod { | ||
pub struct MyStruct { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// compile-flags: -Zsave-analysis | ||
// Also regression test for #69409 | ||
|
||
struct Cat { | ||
meows : usize, | ||
how_hungry : isize, | ||
} | ||
|
||
impl Cat { | ||
pub fn speak(&self) { self.meows += 1; } | ||
} | ||
|
||
fn cat(in_x : usize, in_y : isize) -> Cat { | ||
Cat { | ||
meows: in_x, | ||
how_hungry: in_y | ||
} | ||
} | ||
|
||
fn main() { | ||
let nyan : Cat = cat(52, 99); | ||
nyan.speak = || println!("meow"); //~ ERROR attempted to take value of method | ||
nyan.speak += || println!("meow"); //~ ERROR attempted to take value of method | ||
} |
12 changes: 6 additions & 6 deletions
12
src/test/ui/assign-to-method.stderr → src/test/ui/methods/assign-to-method.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters