Skip to content

Commit 19550e4

Browse files
authored
Rollup merge of rust-lang#65471 - GuillaumeGomez:long-err-explanation-E0578, r=Dylan-DPC
Add long error explanation for E0578 Part of rust-lang#61137 r? @kinnison
2 parents 9f6420b + bfe9c9e commit 19550e4

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/librustc_resolve/error_codes.rs

+28-1
Original file line numberDiff line numberDiff line change
@@ -1850,6 +1850,34 @@ fn main() {}
18501850
```
18511851
"##,
18521852

1853+
E0578: r##"
1854+
A module cannot be found and therefore, the visibility cannot be determined.
1855+
1856+
Erroneous code example:
1857+
1858+
```compile_fail,E0578,edition2018
1859+
foo!();
1860+
1861+
pub (in ::Sea) struct Shark; // error!
1862+
1863+
fn main() {}
1864+
```
1865+
1866+
Because of the call to the `foo` macro, the compiler guesses that the missing
1867+
module could be inside it and fails because the macro definition cannot be
1868+
found.
1869+
1870+
To fix this error, please be sure that the module is in scope:
1871+
1872+
```edition2018
1873+
pub mod Sea {
1874+
pub (in crate::Sea) struct Shark;
1875+
}
1876+
1877+
fn main() {}
1878+
```
1879+
"##,
1880+
18531881
E0603: r##"
18541882
A private item was used outside its scope.
18551883
@@ -2017,5 +2045,4 @@ fn main() {}
20172045
// E0427, merged into 530
20182046
// E0467, removed
20192047
// E0470, removed
2020-
E0578,
20212048
}

src/test/ui/resolve/visibility-indeterminate.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ LL | foo!();
1212

1313
error: aborting due to 2 previous errors
1414

15+
For more information about this error, try `rustc --explain E0578`.

0 commit comments

Comments
 (0)