Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. trait Slice<T> {} type CloneySlice = impl Clone + Slice<RangeTo<usize>>;
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error[E0412]: cannot find type `RangeTo` in this scope
  14. --> src/main.rs:6:65
  15. |
  16. 6 | trait Slice<T> {} type CloneySlice = impl Clone + Slice<RangeTo<usize>>;
  17. | ^^^^^^^ not found in this scope
  18. help: possible candidates are found in other modules, you can import them into scope
  19. |
  20. 4 | use core::ops::RangeTo;
  21. |
  22. 4 | use nom::lib::std::ops::RangeTo;
  23. |
  24. 4 | use std::ops::RangeTo;
  25. |
  26.  
  27. error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
  28. --> src/main.rs:6:46
  29. |
  30. 6 | trait Slice<T> {} type CloneySlice = impl Clone + Slice<RangeTo<usize>>;
  31. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  32.  
  33. error: aborting due to 2 previous errors
  34.  
  35. Some errors have detailed explanations: E0412, E0562.
  36. For more information about an error, try `rustc --explain E0412`.
  37. error: Could not compile `playground`.
  38.  
  39. To learn more, run the command again with --verbose.
  40.  
  41. */
  42.  
  43. /* ~~~~=== stdout ===~~~~
  44.  
  45. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement