mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +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() {}
|