Parsing error on `box` keyword
I tried this code:
fn foo(x: i32) -> Box<i32> {
box x
}
I expected to see this happen: no parsing error, but an error about that syntax being experimental
Instead, this happened: unexpected token box
This is not an issue for the libcore 1.49 project, but we will need to eventually handle that syntax for liballoc and libstd 1.49. This requires parsing as well as proper handling later in the pipeline.
With recent rustc versions this has been replaced with impl Box<T> { fn new(val: T) -> Box<T> { #[rustc_box] Box::new(val) } } which effectively does the same.
Ah, that's nice thanks @bjorn3! I like that more. But if we want to compile liballoc 1.49 we'll sadly still have to deal with it
I'll work on this one.