diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-10-14 13:13:38 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-10-29 13:56:19 +0100 |
| commit | c8420db21d6d64ed9ce8c7937ad7ceda0eee8d20 (patch) | |
| tree | 0b7c898f84d87f82f722d08faa78790da8bcd01f | |
| parent | eb5ef813f0d6e3fe8edd3abb046a18f5b1a8cc48 (diff) | |
| download | rust-c8420db21d6d64ed9ce8c7937ad7ceda0eee8d20.tar.gz rust-c8420db21d6d64ed9ce8c7937ad7ceda0eee8d20.zip | |
Create new error code E0740 for visibility restrictions to ancestor module issues
| -rw-r--r-- | src/librustc_resolve/build_reduced_graph.rs | 6 | ||||
| -rw-r--r-- | src/librustc_resolve/error_codes.rs | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index c18bdfad22c..3564aefba73 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -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 } } diff --git a/src/librustc_resolve/error_codes.rs b/src/librustc_resolve/error_codes.rs index 9515c87ce4b..b76373703d1 100644 --- a/src/librustc_resolve/error_codes.rs +++ b/src/librustc_resolve/error_codes.rs @@ -1953,4 +1953,5 @@ struct Foo<X = Box<Self>> { // E0470, removed E0577, E0578, + E0740, } |
