mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
beaf31581a
When encoutering a privacy error on an item through a re-export that is accessible in an alternative path, provide a structured suggestion with that path. ``` error[E0603]: module import `mem` is private --> $DIR/private-std-reexport-suggest-public.rs:4:14 | LL | use foo::mem; | ^^^ private module import | note: the module import `mem` is defined here... --> $DIR/private-std-reexport-suggest-public.rs:8:9 | LL | use std::mem; | ^^^^^^^^ note: ...and refers to the module `mem` which is defined here --> $SRC_DIR/std/src/lib.rs:LL:COL | = note: you could import this help: import `mem` through the re-export | LL | use std::mem; | ~~~~~~~~ ``` Fix #42909.
30 lines
800 B
Plaintext
30 lines
800 B
Plaintext
error[E0432]: unresolved import `bar::foo`
|
|
--> $DIR/privacy2.rs:19:9
|
|
|
|
|
LL | use bar::foo;
|
|
| ^^^^^^^^ no `foo` in `bar`
|
|
|
|
error[E0603]: function import `foo` is private
|
|
--> $DIR/privacy2.rs:25:20
|
|
|
|
|
LL | use bar::glob::foo;
|
|
| ^^^ private function import
|
|
|
|
|
note: the function import `foo` is defined here...
|
|
--> $DIR/privacy2.rs:12:13
|
|
|
|
|
LL | use foo;
|
|
| ^^^
|
|
note: ...and refers to the function `foo` which is defined here
|
|
--> $DIR/privacy2.rs:16:1
|
|
|
|
|
LL | pub fn foo() {}
|
|
| ^^^^^^^^^^^^ you could import this directly
|
|
|
|
error: requires `sized` lang_item
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
Some errors have detailed explanations: E0432, E0603.
|
|
For more information about an error, try `rustc --explain E0432`.
|