Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. fn f<T: 'static + Sized>(v: V) -> &'static str { unsafe { std::intrinsics::type_name::<T>() } } f(1)
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error[E0465]: multiple rlib candidates for `debug_unreachable` found
  14. |
  15. = note: candidate #1: /playground/target/debug/deps/libdebug_unreachable-fa055998ad9039b1.rlib
  16. = note: candidate #2: /playground/target/debug/deps/libdebug_unreachable-bd2d2a032b9a50fd.rlib
  17.  
  18. error[E0412]: cannot find type `V` in this scope
  19. --> src/main.rs:6:38
  20. |
  21. 6 | fn f<T: 'static + Sized>(v: V) -> &'static str { unsafe { std::intrinsics::type_name::<T>() } } f(1)
  22. | ^ help: a type parameter with a similar name exists: `T`
  23.  
  24. error[E0658]: use of unstable library feature 'core_intrinsics': intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library
  25. --> src/main.rs:6:68
  26. |
  27. 6 | fn f<T: 'static + Sized>(v: V) -> &'static str { unsafe { std::intrinsics::type_name::<T>() } } f(1)
  28. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  29.  
  30. error: aborting due to 3 previous errors
  31.  
  32. Some errors occurred: E0412, E0465, E0658.
  33. For more information about an error, try `rustc --explain E0412`.
  34. error: Could not compile `playground`.
  35.  
  36. To learn more, run the command again with --verbose.
  37.  
  38. */
  39.  
  40. /* ~~~~=== stdout ===~~~~
  41.  
  42. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement