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

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() {}