Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- enum E { A, B } 0 as E
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0277]: `main::E` doesn't implement `std::fmt::Debug`
- --> src/main.rs:4:22
- |
- 4 | println!("{:?}", {
- | ______________________^
- 5 | | enum E { A, B } 0 as E
- 6 | | });
- | |_____^ `main::E` cannot be formatted using `:?`; add `#[derive(Debug)]` or manually implement `std::fmt::Debug`
- |
- = help: the trait `std::fmt::Debug` is not implemented for `main::E`
- = note: required by `std::fmt::Debug::fmt`
- error[E0605]: non-primitive cast: `{integer}` as `main::E`
- --> src/main.rs:5:25
- |
- 5 | enum E { A, B } 0 as E
- | ^^^^^^
- |
- = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
- error: aborting due to 2 previous errors
- Some errors occurred: E0277, E0605.
- For more information about an error, try `rustc --explain E0277`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment