Created
September 17, 2019 17:24
-
-
Save rust-play/8939d40e56d65ba69e6b1ddcb7c9c7bc to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(unreachable_code)] | |
fn main() { | |
println!("{:?}", { | |
u32::try_from(-1i32) | |
}); | |
} | |
/* ~~~~=== stderr ===~~~~ | |
Compiling playground v0.0.1 (/playground) | |
error[E0599]: no function or associated item named `try_from` found for type `u32` in the current scope | |
--> src/main.rs:6:14 | |
| | |
6 | u32::try_from(-1i32) | |
| ^^^^^^^^ function or associated item not found in `u32` | |
| | |
= help: items from traits can only be used if the trait is in scope | |
help: the following trait is implemented but not in scope, perhaps add a `use` for it: | |
| | |
4 | use std::convert::TryFrom; | |
| | |
error: aborting due to previous error | |
For more information about this error, try `rustc --explain E0599`. | |
error: Could not compile `playground`. | |
To learn more, run the command again with --verbose. | |
*/ | |
/* ~~~~=== stdout ===~~~~ | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment