Closed
Description
fn main() {
let y = "foo";
let x = y[1..2];
}
<anon>:3:9: 3:10 error: the trait `core::marker::Sized` is not implemented for the type `str`
<anon>:3 let x = y[1..2];
^
The fix is to write let x = &y[1..2];
but it's not the first thing that springs to mind given that error message, especially for a beginner.
cc #20783