Skip to content

Commit 173e2be

Browse files
committed
Write diagnostics for E0364 and E0365
1 parent e4e9319 commit 173e2be

File tree

1 file changed

+61
-3
lines changed

1 file changed

+61
-3
lines changed

src/librustc_resolve/diagnostics.rs

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,66 @@ See the Types section of the reference for more information about the primitive
197197
types:
198198
199199
http://doc.rust-lang.org/reference.html#types
200+
"##,
201+
202+
E0364: r##"
203+
Private items cannot be publicly re-exported. This error indicates
204+
that you attempted to write a 'pub use' against a type or value that was
205+
not itself public.
206+
207+
Here is an example that demonstrates the error:
208+
209+
```
210+
mod foo {
211+
const X: u32 = 1;
212+
}
213+
pub use foo::X;
214+
```
215+
216+
The solution to this problem is to ensure that the items that you are
217+
re-exporting are themselves marked with 'pub':
218+
219+
```
220+
mod foo {
221+
pub const X: u32 = 1;
222+
}
223+
pub use foo::X;
224+
```
225+
226+
See the Use Declarations section of the reference for more information
227+
on this topic:
228+
229+
http://doc.rust-lang.org/reference.html#use-declarations
230+
"##,
231+
232+
E0365: r##"
233+
Private modules cannot be publicly re-exported. This error indicates
234+
that you attempted to write a 'pub use' against a module that was
235+
not itself public.
236+
237+
Here is an example that demonstrates the error:
238+
239+
```
240+
mod foo {
241+
pub const X: u32 = 1;
242+
}
243+
pub use foo as foo2;
244+
245+
```
246+
The solution to this problem is to ensure that the module that you are
247+
re-exporting is itself marked with 'pub':
248+
249+
```
250+
pub mod foo {
251+
pub const X: u32 = 1;
252+
}
253+
pub use foo as foo2;
254+
```
255+
256+
See the Use Declarations section of the reference for more information
257+
on this topic:
258+
259+
http://doc.rust-lang.org/reference.html#use-declarations
200260
"##
201261

202262
}
@@ -207,7 +267,5 @@ register_diagnostics! {
207267
E0253, // not directly importable
208268
E0254, // import conflicts with imported crate in this module
209269
E0257,
210-
E0258,
211-
E0364, // item is private
212-
E0365 // item is private
270+
E0258
213271
}

0 commit comments

Comments
 (0)