Guest User

Untitled

a guest
Apr 26th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. use std::any::Any;
  2.  
  3. trait Trait {}
  4. struct A;
  5. impl Trait for A {}
  6.  
  7. fn foo() -> impl Trait {
  8. A
  9. }
  10. fn main() {
  11. let x = foo();
  12. println!("{}", (&x as &Any).is::<A>());
  13. }
Add Comment
Please, Sign In to add comment