`mod` inside blocks

This compiles and works:

fn main() {
    #[path="wat"]
    mod wat;
}

Is that an intentional design, or just a side effect of general flexibility of the compiler?

I think this is intentional: https://github.com/rust-lang/rust/issues/29765.

Thanks for the pointer. From the issue it seems that everyone agrees it's weird, but someone has used it in a macro. sigh.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.