about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTakayuki Maeda <takoyaki0316@gmail.com>2022-04-11 22:15:45 +0900
committerTakayuki Maeda <takoyaki0316@gmail.com>2022-04-11 22:15:45 +0900
commitc4b83362c09a2f497b2845fc83c07eb8e0c9175e (patch)
tree63f56dc53cc7ede97311ed4ee1a6b1a6d5fc756e
parentd00e77078c0bd003323af67b4deb27627226d2e6 (diff)
downloadrust-c4b83362c09a2f497b2845fc83c07eb8e0c9175e.tar.gz
rust-c4b83362c09a2f497b2845fc83c07eb8e0c9175e.zip
fix a bad error message for `relative paths are not supported in visibilities` error
-rw-r--r--compiler/rustc_resolve/src/diagnostics.rs2
-rw-r--r--src/test/ui/privacy/restricted/relative-2018.rs2
-rw-r--r--src/test/ui/privacy/restricted/relative-2018.stderr2
3 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index 609dbd1fe1b..de2229f742d 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -632,7 +632,7 @@ impl<'a> Resolver<'a> {
             VisResolutionError::Relative2018(span, path) => {
                 let mut err = self.session.struct_span_err(
                     span,
-                    "relative paths are not supported in visibilities on 2018 edition",
+                    "relative paths are not supported in visibilities in 2018 edition or later",
                 );
                 err.span_suggestion(
                     path.span,
diff --git a/src/test/ui/privacy/restricted/relative-2018.rs b/src/test/ui/privacy/restricted/relative-2018.rs
index 69b7c1e4d4f..954169a9ffb 100644
--- a/src/test/ui/privacy/restricted/relative-2018.rs
+++ b/src/test/ui/privacy/restricted/relative-2018.rs
@@ -7,7 +7,7 @@ mod m {
     pub(in ::core) struct S4;
     //~^ ERROR visibilities can only be restricted to ancestor modules
     pub(in a::b) struct S5;
-    //~^ ERROR relative paths are not supported in visibilities on 2018 edition
+    //~^ ERROR relative paths are not supported in visibilities in 2018 edition or later
 }
 
 fn main() {}
diff --git a/src/test/ui/privacy/restricted/relative-2018.stderr b/src/test/ui/privacy/restricted/relative-2018.stderr
index 54fee085ee9..dec0d5157da 100644
--- a/src/test/ui/privacy/restricted/relative-2018.stderr
+++ b/src/test/ui/privacy/restricted/relative-2018.stderr
@@ -4,7 +4,7 @@ error[E0742]: visibilities can only be restricted to ancestor modules
 LL |     pub(in ::core) struct S4;
    |            ^^^^^^
 
-error: relative paths are not supported in visibilities on 2018 edition
+error: relative paths are not supported in visibilities in 2018 edition or later
   --> $DIR/relative-2018.rs:9:12
    |
 LL |     pub(in a::b) struct S5;