summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-02-23 11:21:29 +0000
committerbors <bors@rust-lang.org>2018-02-23 11:21:29 +0000
commit063deba92e44809125a433ca6e6c1ad0993313bf (patch)
tree95ff2922a9ae38b3059361343514e920f2931a4d /src/test/ui/error-codes
parent928435305ad1d778d7c4d2c2ff989c6a87be0223 (diff)
parent8e9fa57055a083ebc2378d855514166e3ec7a566 (diff)
downloadrust-063deba92e44809125a433ca6e6c1ad0993313bf.tar.gz
rust-063deba92e44809125a433ca6e6c1ad0993313bf.zip
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.
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0449.stderr10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/test/ui/error-codes/E0449.stderr b/src/test/ui/error-codes/E0449.stderr
index 2270167303a..3587319ed0c 100644
--- a/src/test/ui/error-codes/E0449.stderr
+++ b/src/test/ui/error-codes/E0449.stderr
@@ -2,23 +2,21 @@ error[E0449]: unnecessary visibility qualifier
   --> $DIR/E0449.rs:17:1
    |
 17 | pub impl Bar {} //~ ERROR E0449
-   | ^^^^^^^^^^^^^^^ `pub` not needed here
+   | ^^^ `pub` not needed here
    |
    = note: place qualifiers on individual impl items instead
 
 error[E0449]: unnecessary visibility qualifier
   --> $DIR/E0449.rs:19:1
    |
-19 | / pub impl Foo for Bar { //~ ERROR E0449
-20 | |     pub fn foo() {} //~ ERROR E0449
-21 | | }
-   | |_^ `pub` not needed here
+19 | pub impl Foo for Bar { //~ ERROR E0449
+   | ^^^ `pub` not needed here
 
 error[E0449]: unnecessary visibility qualifier
   --> $DIR/E0449.rs:20:5
    |
 20 |     pub fn foo() {} //~ ERROR E0449
-   |     ^^^^^^^^^^^^^^^ `pub` not needed here
+   |     ^^^ `pub` not needed here
 
 error: aborting due to 3 previous errors