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 05:26:59 +04:30
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 08:50:43 +04:30
*input = self.0; //~ ERROR cannot assign
2021-05-09 05:26:59 +04:30
}
}
struct Test2(i32);
impl Hello for Test2 {
fn example(&self, input: &i32) { // should not suggest here
2021-05-11 08:50:43 +04:30
self.0 += *input; //~ ERROR cannot assign
2021-05-09 05:26:59 +04:30
}
}
fn main() { }