]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #36789 - jseyfried:non_inline_mod_in_block, r=nikomatsakis
authorJonathan Turner <jonathandturner@users.noreply.github.com>
Thu, 29 Sep 2016 03:21:52 +0000 (20:21 -0700)
committerGitHub <noreply@github.com>
Thu, 29 Sep 2016 03:21:52 +0000 (20:21 -0700)
commitf1ea5cc273d425033ad430c8fbc28bae1013b45a
tree8298328989f66af7994b8c5c42ceecc420eea1f0
parent13c8e763d4d69732419fa1d23bdbf310be4b597f
parent174f0936514d7e7224c34a78699733eea498875e
Rollup merge of #36789 - jseyfried:non_inline_mod_in_block, r=nikomatsakis

Allow more non-inline modules in blocks

Currently, non-inline modules without a `#[path]` attribute are not allowed in blocks.
This PR allows non-inline modules that have an ancestor module with a `#[path]` attribute, provided there is not a nearer ancestor block.

For example,
```rust
fn main() {
    #[path = "..."] mod foo {
        mod bar; //< allowed by this PR
        fn f() {
            mod bar; //< still an error
        }
    }
}
```

Fixes #36772.
r? @nikomatsakis
src/libsyntax/ext/base.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/parse/parser.rs