-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #69422 - JohnTitor:remove-unwrap, r=Xanewok
- Loading branch information
Showing
6 changed files
with
43 additions
and
35 deletions.
There are no files selected for viewing
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 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
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