Skip to content

Commit

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

trait Trait {
fn static_call(&self) where Self: Sized;

fn maybe_dynamic_call(&self) {
unimplemented!("unsupported maybe_dynamic_call");
}
}

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

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

fn main() {}

0 comments on commit b3ac42b

Please sign in to comment.