Forbid unnecessary visibility on view items
For `use` statements, this means disallowing qualifiers when in functions and disallowing `priv` outside of functions. For `extern mod` statements, this means disallowing everything everywhere. It may have been envisioned for `pub extern mod foo` to be a thing, but it currently doesn't do anything (resolve doesn't pick it up), so better to err on the side of forwards-compatibility and forbid it entirely for now. Closes #9957
This commit is contained in:
parent
9434e7c6cb
commit
4a78364d49
5 changed files with 55 additions and 6 deletions
|
@ -73,7 +73,7 @@ impl fold::Folder for StandardLibraryInjector {
|
|||
with_version("std"),
|
||||
ast::DUMMY_NODE_ID),
|
||||
attrs: ~[],
|
||||
vis: ast::Private,
|
||||
vis: ast::Inherited,
|
||||
span: DUMMY_SP
|
||||
}];
|
||||
|
||||
|
@ -83,7 +83,7 @@ impl fold::Folder for StandardLibraryInjector {
|
|||
with_version("green"),
|
||||
ast::DUMMY_NODE_ID),
|
||||
attrs: ~[],
|
||||
vis: ast::Private,
|
||||
vis: ast::Inherited,
|
||||
span: DUMMY_SP
|
||||
});
|
||||
vis.push(ast::ViewItem {
|
||||
|
@ -91,7 +91,7 @@ impl fold::Folder for StandardLibraryInjector {
|
|||
with_version("rustuv"),
|
||||
ast::DUMMY_NODE_ID),
|
||||
attrs: ~[],
|
||||
vis: ast::Private,
|
||||
vis: ast::Inherited,
|
||||
span: DUMMY_SP
|
||||
});
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ impl fold::Folder for StandardLibraryInjector {
|
|||
let vi2 = ast::ViewItem {
|
||||
node: ast::ViewItemUse(~[vp]),
|
||||
attrs: ~[],
|
||||
vis: ast::Private,
|
||||
vis: ast::Inherited,
|
||||
span: DUMMY_SP,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue