-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-DSTsArea: Dynamically-sized types (DSTs)Area: Dynamically-sized types (DSTs)
Description
I'm working on #16918, and as part of the DSTification of Hash
, I'm adding tests to make sure that hashing Box<[T]>
and Box<str>
work. But there doesn't seem to be a way to create a boxed str.
I tried the following:
fn main() {
let _: Box<str> = box "a";
//^~ error: mismatched types: expected `Box<str>`, found `Box<&'static str>`
let _: Box<str> = box *"a";
//^~ error: cannot move a value of type str: the size of str cannot be statically determined
}
cc @nick29581
mateja176bingli224
Metadata
Metadata
Assignees
Labels
A-DSTsArea: Dynamically-sized types (DSTs)Area: Dynamically-sized types (DSTs)