Skip to content

Commit c3d6082

Browse files
authored
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
2 parents 8d46f9c + c4b8336 commit c3d6082

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

compiler/rustc_resolve/src/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ impl<'a> Resolver<'a> {
632632
VisResolutionError::Relative2018(span, path) => {
633633
let mut err = self.session.struct_span_err(
634634
span,
635-
"relative paths are not supported in visibilities on 2018 edition",
635+
"relative paths are not supported in visibilities in 2018 edition or later",
636636
);
637637
err.span_suggestion(
638638
path.span,

src/test/ui/privacy/restricted/relative-2018.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mod m {
77
pub(in ::core) struct S4;
88
//~^ ERROR visibilities can only be restricted to ancestor modules
99
pub(in a::b) struct S5;
10-
//~^ ERROR relative paths are not supported in visibilities on 2018 edition
10+
//~^ ERROR relative paths are not supported in visibilities in 2018 edition or later
1111
}
1212

1313
fn main() {}

src/test/ui/privacy/restricted/relative-2018.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0742]: visibilities can only be restricted to ancestor modules
44
LL | pub(in ::core) struct S4;
55
| ^^^^^^
66

7-
error: relative paths are not supported in visibilities on 2018 edition
7+
error: relative paths are not supported in visibilities in 2018 edition or later
88
--> $DIR/relative-2018.rs:9:12
99
|
1010
LL | pub(in a::b) struct S5;

0 commit comments

Comments
 (0)