Guest User

Untitled

a guest
Dec 11th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. u8::from(3.14159265358979323846264338327950288_f64)
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error[E0277]: the trait bound `u8: std::convert::From<f64>` is not satisfied
  14. --> src/main.rs:6:9
  15. |
  16. 6 | u8::from(3.14159265358979323846264338327950288_f64)
  17. | ^^^^^^^^ the trait `std::convert::From<f64>` is not implemented for `u8`
  18. |
  19. = help: the following implementations were found:
  20. <u8 as std::convert::From<bool>>
  21. <u8 as std::convert::From<std::num::NonZeroU8>>
  22. = note: required by `std::convert::From::from`
  23.  
  24. error: aborting due to previous error
  25.  
  26. For more information about this error, try `rustc --explain E0277`.
  27. error: Could not compile `playground`.
  28.  
  29. To learn more, run the command again with --verbose.
  30.  
  31. */
  32.  
  33. /* ~~~~=== stdout ===~~~~
  34.  
  35. */
Add Comment
Please, Sign In to add comment