if self.r.is_accessible_from(vis, parent_scope.module) {
vis
} else {
- struct_span_err!(self.r.session, path.span, E0741,
+ struct_span_err!(self.r.session, path.span, E0742,
"visibilities can only be restricted to ancestor modules")
.emit();
ty::Visibility::Public
Const parameters cannot depend on type parameters.
The following is therefore invalid:
+
```compile_fail,E0741
#![feature(const_generics)]
```
"##,
-E0741: r##"
+E0742: r##"
Visibility is restricted to a module which isn't an ancestor of the current
item.
Erroneous code example:
-```compile_fail,E0741,edition2018
+```compile_fail,E0742,edition2018
pub mod Sea {}
pub (in crate::Sea) struct Shark; // error!
-error[E0741]: visibilities can only be restricted to ancestor modules
+error[E0742]: visibilities can only be restricted to ancestor modules
--> $DIR/relative-2018.rs:7:12
|
LL | pub(in ::core) struct S4;
error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0741`.
+For more information about this error, try `rustc --explain E0742`.
LL | pub(in bad::path) mod m1 {}
| ^^^ maybe a missing crate `bad`?
-error[E0741]: visibilities can only be restricted to ancestor modules
+error[E0742]: visibilities can only be restricted to ancestor modules
--> $DIR/test.rs:51:12
|
LL | pub(in foo) mod m2 {}
error: aborting due to 12 previous errors
-Some errors have detailed explanations: E0364, E0433, E0603, E0616, E0624, E0741.
+Some errors have detailed explanations: E0364, E0433, E0603, E0616, E0624, E0742.
For more information about an error, try `rustc --explain E0364`.
-error[E0741]: visibilities can only be restricted to ancestor modules
+error[E0742]: visibilities can only be restricted to ancestor modules
--> $DIR/issue-50493.rs:8:12
|
LL | pub(in restricted) field: usize,
error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0616, E0741.
+Some errors have detailed explanations: E0616, E0742.
For more information about an error, try `rustc --explain E0616`.
`pub(super)`: visible only in the current module's parent
`pub(in path::to::module)`: visible only on the specified path
-error[E0741]: visibilities can only be restricted to ancestor modules
+error[E0742]: visibilities can only be restricted to ancestor modules
--> $DIR/pub-restricted.rs:25:17
|
LL | pub (in x) non_parent_invalid: usize,
error: aborting due to 6 previous errors
-Some errors have detailed explanations: E0704, E0741.
+Some errors have detailed explanations: E0704, E0742.
For more information about an error, try `rustc --explain E0704`.
LL | pub(in Tr) struct Z;
| ^^ not a module
-error[E0741]: visibilities can only be restricted to ancestor modules
+error[E0742]: visibilities can only be restricted to ancestor modules
--> $DIR/resolve-bad-visibility.rs:6:8
|
LL | pub(in std::vec) struct F;
error: aborting due to 5 previous errors
-Some errors have detailed explanations: E0433, E0741.
+Some errors have detailed explanations: E0433, E0742.
For more information about an error, try `rustc --explain E0433`.