Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- #[derive(Debug)] enum E { A, B } 0 as E
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0605]: non-primitive cast: `i32` as `main::E`
- --> src/main.rs:5:42
- |
- 5 | #[derive(Debug)] 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 previous error
- For more information about this error, try `rustc --explain E0605`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment