mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
16 lines
225 B
Rust
16 lines
225 B
Rust
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() {}
|