rust/tests/ui/borrowck/argument_number_mismatch_ice.rs

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

16 lines
320 B
Rust
Raw Normal View History

2024-02-13 04:44:50 -06:00
trait Hello {
fn example(val: ());
}
struct Test1(i32);
impl Hello for Test1 {
fn example(&self, input: &i32) {
//~^ ERROR `&self` declaration in the impl, but not in the trait
*input = self.0;
//~^ ERROR cannot assign to `*input`, which is behind a `&` reference
}
}
fn main() {}