rust/tests/ui/borrowck/issue-93078.rs

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

16 lines
225 B
Rust
Raw Normal View History

trait Modify {
fn modify(&mut self) ;
}
impl<T> Modify for T {
fn modify(&mut self) {}
}
trait Foo {
fn mute(&mut self) {
self.modify(); //~ ERROR cannot borrow `self` as mutable
}
}
fn main() {}