Skip to content

Commit 84c371d

Browse files
committed
add mut test
1 parent 1dd6151 commit 84c371d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// check-pass
2+
3+
trait Trait {
4+
fn static_call(&mut self) where Self: Sized;
5+
fn maybe_dynamic_call(&self) {
6+
unimplemented!("unsupported maybe_dynamic_call");
7+
}
8+
}
9+
10+
impl<T: ?Sized + Trait> Trait for &mut T {
11+
fn static_call(&mut self) where Self: Sized {
12+
(**self).maybe_dynamic_call();
13+
}
14+
}
15+
16+
fn foo(mut x: &mut dyn Trait) {
17+
x.static_call();
18+
}
19+
20+
fn main() {}

0 commit comments

Comments
 (0)