Skip to content

Commit 0771b89

Browse files
Create new error code E0740 for visibility restrictions to ancestor module issues
1 parent 14f0ed6 commit 0771b89

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
@@ -268,9 +268,9 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
268268
if self.r.is_accessible_from(vis, parent_scope.module) {
269269
vis
270270
} else {
271-
let msg =
272-
"visibilities can only be restricted to ancestor modules";
273-
self.r.session.span_err(path.span, msg);
271+
struct_span_err!(self.r.session, path.span, E0741,
272+
"visibilities can only be restricted to ancestor modules")
273+
.emit();
274274
ty::Visibility::Public
275275
}
276276
}

src/librustc_resolve/error_codes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,4 +1918,5 @@ struct Foo<X = Box<Self>> {
19181918
E0576,
19191919
E0577,
19201920
E0578,
1921+
E0740,
19211922
}

0 commit comments

Comments
 (0)