Create new error code E0740 for visibility restrictions to ancestor module issues

This commit is contained in:
Guillaume Gomez 2019-10-14 13:13:38 +02:00
parent eb5ef813f0
commit c8420db21d
2 changed files with 4 additions and 3 deletions

View File

@ -256,9 +256,9 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
if self.r.is_accessible_from(vis, parent_scope.module) {
vis
} else {
let msg =
"visibilities can only be restricted to ancestor modules";
self.r.session.span_err(path.span, msg);
struct_span_err!(self.r.session, path.span, E0741,
"visibilities can only be restricted to ancestor modules")
.emit();
ty::Visibility::Public
}
}

View File

@ -1953,4 +1953,5 @@ struct Foo<X = Box<Self>> {
// E0470, removed
E0577,
E0578,
E0740,
}