Guest User

Untitled

a guest
Jun 17th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. fn main() {
  2. println!("{:?}", {
  3. enum SomeEnum<'a, T> where T: 'a { Something(&'a T), } let a: SomeEnum<'static, Clone>;
  4. });
  5. }
  6.  
  7.  
  8. /* ~~~~=== stderr ===~~~~
  9. Compiling playground v0.0.1 (file:///playground)
  10. error[E0277]: the trait bound `std::clone::Clone + 'static: std::marker::Sized` is not satisfied
  11. --> src/main.rs:5:71
  12. |
  13. 5 | enum SomeEnum<'a, T> where T: 'a { Something(&'a T), } let a: SomeEnum<'static, Clone>;
  14. | ^^^^^^^^^^^^^^^^^^^^^^^^ `std::clone::Clone + 'static` does not have a constant size known at compile-time
  15. |
  16. = help: the trait `std::marker::Sized` is not implemented for `std::clone::Clone + 'static`
  17. note: required by `main::SomeEnum`
  18. --> src/main.rs:5:9
  19. |
  20. 5 | enum SomeEnum<'a, T> where T: 'a { Something(&'a T), } let a: SomeEnum<'static, Clone>;
  21. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  22.  
  23. error[E0038]: the trait `std::clone::Clone` cannot be made into an object
  24. --> src/main.rs:5:71
  25. |
  26. 5 | enum SomeEnum<'a, T> where T: 'a { Something(&'a T), } let a: SomeEnum<'static, Clone>;
  27. | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` cannot be made into an object
  28. |
  29. = note: the trait cannot require that `Self : Sized`
  30.  
  31. error: aborting due to 2 previous errors
  32.  
  33. Some errors occurred: E0038, E0277.
  34. For more information about an error, try `rustc --explain E0038`.
  35. error: Could not compile `playground`.
  36.  
  37. To learn more, run the command again with --verbose.
  38.  
  39. */
  40.  
  41. /* ~~~~=== stdout ===~~~~
  42.  
  43. */
Add Comment
Please, Sign In to add comment