Rollup merge of #95936 - TaKO8Ki:fix-relative-paths-error-message, r=Dylan-DPC

Fix a bad error message for `relative paths are not supported in visibilities` error

closes #95638
This commit is contained in:
Matthias Krüger 2022-04-12 08:47:01 +02:00 committed by GitHub
commit c3d6082e9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -632,7 +632,7 @@ impl<'a> Resolver<'a> {
VisResolutionError::Relative2018(span, path) => { VisResolutionError::Relative2018(span, path) => {
let mut err = self.session.struct_span_err( let mut err = self.session.struct_span_err(
span, 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( err.span_suggestion(
path.span, path.span,

View file

@ -7,7 +7,7 @@ mod m {
pub(in ::core) struct S4; pub(in ::core) struct S4;
//~^ ERROR visibilities can only be restricted to ancestor modules //~^ ERROR visibilities can only be restricted to ancestor modules
pub(in a::b) struct S5; 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() {} fn main() {}

View file

@ -4,7 +4,7 @@ error[E0742]: visibilities can only be restricted to ancestor modules
LL | pub(in ::core) struct S4; 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 --> $DIR/relative-2018.rs:9:12
| |
LL | pub(in a::b) struct S5; LL | pub(in a::b) struct S5;