Stream: t-compiler/rust-analyzer

Topic: Statement/expression effective scope


ivan770 (Mar 29 2021 at 09:19, on Zulip):

Noob question. How can one obtain a statement/expression effective scope?
Something like for

fn main() {
    let test = 123;
}

effective scope of test would be block of main, but for

fn main() {
    if let Some(test) = Some(123) {
        drop(test);
    }
}

effective scope of test would be block of if itself.

ivan770 (Mar 29 2021 at 10:13, on Zulip):

Not sure why would anyone want such a thing for every available node, so I'll just stick to tree traversing

Last update: Jul 28 2021 at 04:15UTC