mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-09 15:13:57 +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() {}
|