rust-lang / rust-playground

The Rust Playground
https://play.rust-lang.org/
Apache License 2.0
1.2k stars 203 forks source link

Syntax highlighting is thrown off by `<<` #1061

Open RalfJung opened 2 months ago

RalfJung commented 2 months ago

Consider this code:

pub fn f() {
    g::<u32>();
}
pub fn g<T>() -> std::mem::MaybeUninit<[T; 1 << 2]> {
    std::mem::MaybeUninit::uninit()
}

fn main() {
    f();
}

On the playground, fn main does not get syntax highlighting:

image

Seems like the << in a type is throwing it off and then it can't parse the rest of the file any more, or so?

shepmaster commented 1 month ago

Looks like an upstream issue and someone has already proposed a PR: https://github.com/ajaxorg/ace/pull/5572.