rust/tests/ui/imports
Esteban Küber beaf31581a Structured use suggestion on privacy error
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.
2023-12-04 22:26:08 +00:00
..
auxiliary
extern-crate-self
import-crate-with-invalid-spans
issue-26873-multifile
issue-45829 Show number in error message even for one error 2023-11-24 19:15:52 +01:00
absolute-paths-in-nested-use-groups.rs
absolute-paths-in-nested-use-groups.stderr
ambiguous-1.rs
ambiguous-1.stderr
ambiguous-2.rs
ambiguous-3.rs
ambiguous-3.stderr
ambiguous-4-extern.rs
ambiguous-4-extern.stderr
ambiguous-4.rs fix(resolve): update def if binding is warning ambiguity 2023-08-31 20:00:04 +08:00
ambiguous-5.rs
ambiguous-5.stderr
ambiguous-6.rs
ambiguous-6.stderr
ambiguous-7.rs
ambiguous-7.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
ambiguous-8.rs
ambiguous-8.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
ambiguous-9.rs
ambiguous-9.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
ambiguous-10.rs
ambiguous-10.stderr
ambiguous-11.rs
ambiguous-11.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
ambiguous-12.rs
ambiguous-12.stderr
ambiguous-13.rs
ambiguous-13.stderr
ambiguous-14.rs
ambiguous-14.stderr
ambiguous-15.rs
ambiguous-15.stderr
ambiguous-16.rs
ambiguous-16.stderr
ambiguous-17.rs
ambiguous-17.stderr
bad-import-in-nested.rs
bad-import-in-nested.stderr
bad-import-with-rename.rs
bad-import-with-rename.stderr
double-import.rs
double-import.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
duplicate.rs
duplicate.stderr
export-glob-imports-target.rs
export-multi.rs
extern-crate-used.rs
extern-crate-used.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
extern-prelude-extern-crate-absolute-expanded.rs
extern-prelude-extern-crate-cfg.rs
extern-prelude-extern-crate-fail.rs
extern-prelude-extern-crate-fail.stderr
extern-prelude-extern-crate-pass.rs
extern-prelude-extern-crate-restricted-shadowing.rs
extern-prelude-extern-crate-restricted-shadowing.stderr
extern-prelude-extern-crate-shadowing.rs
extern-with-ambiguous-1.rs
extern-with-ambiguous-1.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
extern-with-ambiguous-2.rs
extern-with-ambiguous-3.rs
gensymed.rs
glob-conflict-cross-crate.rs
glob-conflict-cross-crate.stderr
glob-cycles.rs
glob-resolve1.rs
glob-resolve1.stderr
glob-shadowing.rs
glob-shadowing.stderr
glob-use-std.rs
import2-rpass.rs
import2.rs
import2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import3-rpass.rs
import3.rs
import3.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import4-rpass.rs
import4.rs
import4.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import5.rs
import6.rs
import7.rs
import8.rs
import-after-macro-expand-1.rs
import-after-macro-expand-2.rs resolve: determined binding after parent module macro expand 2023-09-13 16:38:05 +08:00
import-after-macro-expand-3.rs
import-after-macro-expand-4.rs resolve: determined binding after parent module macro expand 2023-09-13 16:38:05 +08:00
import-after-macro-expand-5.rs
import-after-macro-expand-6.rs resolve: determined binding after parent module macro expand 2023-09-13 16:38:05 +08:00
import-after-macro-expand-7.rs
import-after-macro-expand-8.rs
import-after-macro-expand-9.rs resolve: determined binding after parent module macro expand 2023-09-13 16:38:05 +08:00
import-after-macro-expand-10.rs resolve: determined binding after parent module macro expand 2023-09-13 16:38:05 +08:00
import-after-macro-expand-11.rs resolve: determined binding after parent module macro expand 2023-09-13 16:38:05 +08:00
import-after-macro-expand-12.rs resolve: determined binding after parent module macro expand 2023-09-13 16:38:05 +08:00
import-after-macro-expand-13.rs resolve: determined binding after parent module macro expand 2023-09-13 16:38:05 +08:00
import-after-macro-expand-14.rs resolve: determined binding after parent module macro expand 2023-09-13 16:38:05 +08:00
import-crate-var.rs
import-crate-var.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import-from-missing.rs
import-from-missing.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import-from.rs
import-glob-0-rpass.rs
import-glob-0.rs
import-glob-0.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import-glob-1.rs
import-glob-circular.rs
import-glob-circular.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import-glob-crate.rs
import-in-block.rs
import-loop-2.rs
import-loop-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import-loop.rs
import-loop.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import-prefix-macro-1.rs
import-prefix-macro-1.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import-prefix-macro-2.rs
import-prefix-macro-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import-prefix-macro.rs
import-rename.rs
import-rpass.rs
import-trailing-comma.rs
import-trait-method.rs
import-trait-method.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
import.rs
import.stderr
imports.rs
inaccessible_type_aliases.rs
inaccessible_type_aliases.stderr
issue-1697.rs
issue-1697.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-2937.rs
issue-2937.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-4366-2.rs
issue-4366-2.stderr
issue-4366.rs
issue-4366.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-4865-1.rs
issue-4865-2.rs
issue-4865-3.rs
issue-8208.rs
issue-8208.stderr
issue-8640.rs
issue-8640.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-13404.rs
issue-13404.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-18083.rs
issue-19498.rs
issue-19498.stderr
issue-24081.rs
issue-24081.stderr
issue-24883.rs
issue-25396.rs
issue-25396.stderr
issue-26886.rs
issue-26886.stderr
issue-26930.rs
issue-28134.rs
issue-28134.stderr Tweak suggestion spans for invalid crate-level inner attribute 2023-10-26 18:35:09 +00:00
issue-28388-1.rs
issue-28388-1.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-28388-2.rs
issue-28388-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-30560.rs
issue-30560.stderr
issue-31212.rs
issue-31212.stderr
issue-32119.rs
issue-32222.rs
issue-32354-suggest-import-rename.fixed
issue-32354-suggest-import-rename.rs
issue-32354-suggest-import-rename.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-32833.rs
issue-32833.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-33464.rs
issue-33464.stderr
issue-36881.rs
issue-36881.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-37887.rs
issue-37887.stderr
issue-38293.rs
issue-38293.stderr
issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed
issue-45799-bad-extern-crate-rename-suggestion-formatting.rs
issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-47623.rs
issue-47623.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-52891.fixed
issue-52891.rs
issue-52891.stderr
issue-53140.rs
issue-53269.rs
issue-53269.stderr
issue-53512.rs
issue-53512.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-53565.rs
issue-53565.stderr
issue-55457.rs
issue-55457.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
issue-55811.rs
issue-55884-1.rs
issue-55884-1.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-55884-2.rs
issue-55884-2.stderr Structured use suggestion on privacy error 2023-12-04 22:26:08 +00:00
issue-56125.rs
issue-56125.stderr on unresolved import disambiguate suggested path if it would collide 2023-10-21 15:40:32 +02:00
issue-56263.rs
issue-57015.rs
issue-57015.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-57539.rs
issue-57539.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-59764.rs
issue-59764.stderr
issue-62767.rs
issue-68103.rs
issue-81413.rs
issue-81413.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-85992.rs
issue-85992.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-99695-b.fixed
issue-99695-b.rs
issue-99695-b.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-99695.fixed
issue-99695.rs
issue-99695.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-109148.rs
issue-109148.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-109343.rs
issue-109343.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-113953.rs
issue-113953.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
local-modularized-tricky-fail-1.rs
local-modularized-tricky-fail-1.stderr
local-modularized-tricky-fail-2.rs
local-modularized-tricky-fail-2.stderr
local-modularized-tricky-pass-1.rs
local-modularized-tricky-pass-2.rs
local-modularized.rs
macro-paths.rs
macro-paths.stderr
macros.rs
macros.stderr
no-pub-reexports-but-used.rs vis note for no pub reexports glob import 2023-12-01 12:10:07 +08:00
no-pub-reexports-but-used.stderr vis note for no pub reexports glob import 2023-12-01 12:10:07 +08:00
no-std-inject.rs
no-std-inject.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
overlapping_pub_trait.rs
overlapping_pub_trait.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
private-std-reexport-suggest-public.fixed Structured use suggestion on privacy error 2023-12-04 22:26:08 +00:00
private-std-reexport-suggest-public.rs Structured use suggestion on privacy error 2023-12-04 22:26:08 +00:00
private-std-reexport-suggest-public.stderr Structured use suggestion on privacy error 2023-12-04 22:26:08 +00:00
pub-reexport-empty.rs use visibility to check unused imports and delete some stmts 2023-10-22 21:27:46 +08:00
pub-reexport-empty.stderr use visibility to check unused imports and delete some stmts 2023-10-22 21:27:46 +08:00
reexport-star.rs
reexports.rs vis note for no pub reexports glob import 2023-12-01 12:10:07 +08:00
reexports.stderr vis note for no pub reexports glob import 2023-12-01 12:10:07 +08:00
resolve_self_super_hint.rs
resolve_self_super_hint.stderr
resolve-other-libc.rs
resolve-other-libc.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-1560-warning-cycle.rs
rfc-1560-warning-cycle.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
shadow_builtin_macros.rs
shadow_builtin_macros.stderr
tool-mod-child.rs
tool-mod-child.stderr
unnamed_pub_trait.rs
unnamed_pub_trait.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unresolved-imports-used.rs
unresolved-imports-used.stderr
unused-import-issue-87973.fixed
unused-import-issue-87973.rs
unused-import-issue-87973.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unused-imports-in-test-mode.rs
unused-imports-in-test-mode.stderr
unused-imports-in-test-module.rs
unused-imports-in-test-module.stderr
unused-macro-use.rs
unused-macro-use.stderr
unused.rs
unused.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
use-mod.rs