Skip to content

Commit c8420db

Browse files
Create new error code E0740 for visibility restrictions to ancestor module issues
1 parent eb5ef81 commit c8420db

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/librustc_resolve/build_reduced_graph.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
256256
if self.r.is_accessible_from(vis, parent_scope.module) {
257257
vis
258258
} else {
259-
let msg =
260-
"visibilities can only be restricted to ancestor modules";
261-
self.r.session.span_err(path.span, msg);
259+
struct_span_err!(self.r.session, path.span, E0741,
260+
"visibilities can only be restricted to ancestor modules")
261+
.emit();
262262
ty::Visibility::Public
263263
}
264264
}

src/librustc_resolve/error_codes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,4 +1953,5 @@ struct Foo<X = Box<Self>> {
19531953
// E0470, removed
19541954
E0577,
19551955
E0578,
1956+
E0740,
19561957
}

0 commit comments

Comments
 (0)