-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-type-systemArea: Type systemArea: Type system
Description
This explicit cast does not work:
fn main() {
let x = Box::new([1, 2, 3]);
let y = x as Box<[i32]>;
println!("y: {:?}", y);
}However, this implicit coercion does work:
fn main() {
let x = Box::new([1, 2, 3]);
let y: Box<[i32]> = x;
println!("y: {:?}", y);
}It is unfortunate, because I would like the overloaded-box inference to work for expr as Box<[T]> in the same manner that it does for expr as Box<Trait>.
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type system