Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. [Box::new::<Display>(5), Box::new("Hello"), Box::new([5, 6, 7])]
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error[E0412]: cannot find type `Display` in this scope
  14. --> src/main.rs:6:21
  15. |
  16. 6 | [Box::new::<Display>(5), Box::new("Hello"), Box::new([5, 6, 7])]
  17. | ^^^^^^^ not found in this scope
  18. help: possible candidates are found in other modules, you can import them into scope
  19. |
  20. 4 | use core::fmt::Display;
  21. |
  22. 4 | use serde::export::fmt::Display;
  23. |
  24. 4 | use std::fmt::Display;
  25. |
  26. 4 | use std::path::Display;
  27. |
  28. and 1 other candidates
  29.  
  30. error[E0107]: wrong number of type arguments: expected 0, found 1
  31. --> src/main.rs:6:21
  32. |
  33. 6 | [Box::new::<Display>(5), Box::new("Hello"), Box::new([5, 6, 7])]
  34. | ^^^^^^^ unexpected type argument
  35.  
  36. error[E0308]: mismatched types
  37. --> src/main.rs:6:43
  38. |
  39. 6 | [Box::new::<Display>(5), Box::new("Hello"), Box::new([5, 6, 7])]
  40. | ^^^^^^^ expected integer, found reference
  41. |
  42. = note: expected type `{integer}`
  43. found type `&'static str`
  44.  
  45. error[E0308]: mismatched types
  46. --> src/main.rs:6:62
  47. |
  48. 6 | [Box::new::<Display>(5), Box::new("Hello"), Box::new([5, 6, 7])]
  49. | ^^^^^^^^^ expected integer, found array of 3 elements
  50. |
  51. = note: expected type `{integer}`
  52. found type `[{integer}; 3]`
  53.  
  54. error: aborting due to 4 previous errors
  55.  
  56. Some errors occurred: E0107, E0308, E0412.
  57. For more information about an error, try `rustc --explain E0107`.
  58. error: Could not compile `playground`.
  59.  
  60. To learn more, run the command again with --verbose.
  61.  
  62. */
  63.  
  64. /* ~~~~=== stdout ===~~~~
  65.  
  66. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement