Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/privacy/restricted/relative-2018.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
2 changes: 1 addition & 1 deletion src/test/ui/privacy/restricted/relative-2018.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down