rust/tests/ui/suggestions/issue-68049-2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
405 B
Rust
Raw Normal View History

2021-05-09 00:56:59 +00:00
trait Hello {
fn example(&self, input: &i32); // should suggest here
}
struct Test1(i32);
impl Hello for Test1 {
fn example(&self, input: &i32) { // should not suggest here
2021-05-11 04:20:43 +00:00
*input = self.0; //~ ERROR cannot assign
2021-05-09 00:56:59 +00:00
}
}
struct Test2(i32);
impl Hello for Test2 {
fn example(&self, input: &i32) { // should not suggest here
2021-05-11 04:20:43 +00:00
self.0 += *input; //~ ERROR cannot assign
2021-05-09 00:56:59 +00:00
}
}
fn main() { }