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-08 19:56:59 -05: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-10 23:20:43 -05:00
*input = self.0; //~ ERROR cannot assign
2021-05-08 19:56:59 -05:00
}
}
struct Test2(i32);
impl Hello for Test2 {
fn example(&self, input: &i32) { // should not suggest here
2021-05-10 23:20:43 -05:00
self.0 += *input; //~ ERROR cannot assign
2021-05-08 19:56:59 -05:00
}
}
fn main() { }