-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Closed
Labels
P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Consider this code:
fn main() {
use std::boxed;
let boxed::Box(..) = boxed::Box::new("Hello");
}on the playpen, it yields the error:
rustc 1.16.0-nightly (4ecc85beb 2016-12-28)
error[E0308]: mismatched types
--> <anon>:3:9
|
3 | let boxed::Box(..) = boxed::Box::new("Hello");
| ^^^^^^^^^^^^^^ expected box, found struct `std::boxed::Box`
|
= note: expected type `Box<&str>`
= note: found type `std::boxed::Box<_>`
error: aborting due to previous error
This is probably an artifact of how we partially treat Boxes as a built-in language feature within the compiler. Nonetheless, we could do better with the message here.
Metadata
Metadata
Assignees
Labels
P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.