Skip to content

Commit 9c2f1dd

Browse files
Add long error explanation for E0578
1 parent b3a0350 commit 9c2f1dd

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/librustc_resolve/error_codes.rs

Lines changed: 28 additions & 1 deletion
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
}

0 commit comments

Comments
 (0)