]> git.lizzy.rs Git - rust.git/commit
Auto merge of #47799 - topecongiro:fix-span-of-visibility, r=petrochenkov
authorbors <bors@rust-lang.org>
Fri, 23 Feb 2018 11:21:29 +0000 (11:21 +0000)
committerbors <bors@rust-lang.org>
Fri, 23 Feb 2018 11:21:29 +0000 (11:21 +0000)
commit063deba92e44809125a433ca6e6c1ad0993313bf
tree95ff2922a9ae38b3059361343514e920f2931a4d
parent928435305ad1d778d7c4d2c2ff989c6a87be0223
parent8e9fa57055a083ebc2378d855514166e3ec7a566
Auto merge of #47799 - topecongiro:fix-span-of-visibility, r=petrochenkov

Fix span of visibility

This PR

1. adds a closing parenthesis to the span of `Visibility::Crate` (e.g. `pub(crate)`). The current span only covers `pub(crate`.
2. adds a `span` field to `Visibility::Restricted`. This span covers the entire visibility expression (e.g. `pub (in self)`). Currently all we can have is a span for `Path`.

This PR is motivated by the bug found in rustfmt (https://github.com/rust-lang-nursery/rustfmt/issues/2398).

The first change is a strict improvement IMHO. The second change may not be desirable, as it adds a field which is currently not used by the compiler.
src/librustc_resolve/check_unused.rs
src/librustc_resolve/lib.rs
src/libsyntax/ast.rs
src/libsyntax/parse/parser.rs