Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- [Box::new::<Display>(5), Box::new("Hello"), Box::new([5, 6, 7])]
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0412]: cannot find type `Display` in this scope
- --> src/main.rs:6:21
- |
- 6 | [Box::new::<Display>(5), Box::new("Hello"), Box::new([5, 6, 7])]
- | ^^^^^^^ not found in this scope
- help: possible candidates are found in other modules, you can import them into scope
- |
- 4 | use core::fmt::Display;
- |
- 4 | use serde::export::fmt::Display;
- |
- 4 | use std::fmt::Display;
- |
- 4 | use std::path::Display;
- |
- and 1 other candidates
- error[E0107]: wrong number of type arguments: expected 0, found 1
- --> src/main.rs:6:21
- |
- 6 | [Box::new::<Display>(5), Box::new("Hello"), Box::new([5, 6, 7])]
- | ^^^^^^^ unexpected type argument
- error[E0308]: mismatched types
- --> src/main.rs:6:43
- |
- 6 | [Box::new::<Display>(5), Box::new("Hello"), Box::new([5, 6, 7])]
- | ^^^^^^^ expected integer, found reference
- |
- = note: expected type `{integer}`
- found type `&'static str`
- error[E0308]: mismatched types
- --> src/main.rs:6:62
- |
- 6 | [Box::new::<Display>(5), Box::new("Hello"), Box::new([5, 6, 7])]
- | ^^^^^^^^^ expected integer, found array of 3 elements
- |
- = note: expected type `{integer}`
- found type `[{integer}; 3]`
- error: aborting due to 4 previous errors
- Some errors occurred: E0107, E0308, E0412.
- For more information about an error, try `rustc --explain E0107`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement