Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- enum SomeEnum<'a, T> where T: 'a { Something(&'a T), } let a: SomeEnum<'static, Clone>;
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0277]: the trait bound `std::clone::Clone + 'static: std::marker::Sized` is not satisfied
- --> src/main.rs:5:71
- |
- 5 | enum SomeEnum<'a, T> where T: 'a { Something(&'a T), } let a: SomeEnum<'static, Clone>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^ `std::clone::Clone + 'static` does not have a constant size known at compile-time
- |
- = help: the trait `std::marker::Sized` is not implemented for `std::clone::Clone + 'static`
- note: required by `main::SomeEnum`
- --> src/main.rs:5:9
- |
- 5 | enum SomeEnum<'a, T> where T: 'a { Something(&'a T), } let a: SomeEnum<'static, Clone>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- error[E0038]: the trait `std::clone::Clone` cannot be made into an object
- --> src/main.rs:5:71
- |
- 5 | enum SomeEnum<'a, T> where T: 'a { Something(&'a T), } let a: SomeEnum<'static, Clone>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` cannot be made into an object
- |
- = note: the trait cannot require that `Self : Sized`
- error: aborting due to 2 previous errors
- Some errors occurred: E0038, E0277.
- For more information about an error, try `rustc --explain E0038`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment