Skip to content

Commit

Permalink
add mut test
Browse files Browse the repository at this point in the history
  • Loading branch information
b-naber committed Mar 21, 2021
1 parent 1dd6151 commit 84c371d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/ui/resolve/issue-82825-mut.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// check-pass

trait Trait {
fn static_call(&mut self) where Self: Sized;
fn maybe_dynamic_call(&self) {
unimplemented!("unsupported maybe_dynamic_call");
}
}

impl<T: ?Sized + Trait> Trait for &mut T {
fn static_call(&mut self) where Self: Sized {
(**self).maybe_dynamic_call();
}
}

fn foo(mut x: &mut dyn Trait) {
x.static_call();
}

fn main() {}

0 comments on commit 84c371d

Please sign in to comment.