rust/tests/ui/privacy
Esteban Küber 7dffd24da5 Tweak privacy errors to account for reachable items
Suggest publicly accessible paths for items in private mod:

  When encountering a path in non-import situations that are not reachable
  due to privacy constraints, search for any public re-exports that the
  user could use instead.

Track whether an import suggestion is offering a re-export.

When encountering a path with private segments, mention if the item at
the final path segment is not publicly accessible at all.

Add item visibility metadata to privacy errors from imports:

  On unreachable imports, record the item that was being imported in order
  to suggest publicly available re-exports or to be explicit that the item
  is not available publicly from any path.

  In order to allow this, we add a mode to `resolve_path` that will not
  add new privacy errors, nor return early if it encounters one. This way
  we can get the `Res` corresponding to the final item in the import,
  which is used in the privacy error machinery.
2023-06-22 16:50:31 +00:00
..
auxiliary
pub-priv-dep
restricted
sealed-traits Tweak privacy errors to account for reachable items 2023-06-22 16:50:31 +00:00
associated-item-privacy-inherent.rs
associated-item-privacy-inherent.stderr
associated-item-privacy-trait.rs
associated-item-privacy-trait.stderr
associated-item-privacy-type-binding.rs
associated-item-privacy-type-binding.stderr
crate-private-reexport.rs
crate-private-reexport.stderr
ctor.rs
decl-macro.rs
decl-macro.stderr
effective_visibilities_full_priv.rs increase the accuracy of effective visibilities calculation 2023-06-08 19:22:30 +03:00
effective_visibilities_full_priv.stderr increase the accuracy of effective visibilities calculation 2023-06-08 19:22:30 +03:00
effective_visibilities_glob.rs
effective_visibilities_glob.stderr
effective_visibilities_invariants.rs
effective_visibilities_invariants.stderr
effective_visibilities.rs
effective_visibilities.stderr
export-tag-variant.rs
export-tag-variant.stderr Tweak privacy errors to account for reachable items 2023-06-22 16:50:31 +00:00
impl-privacy-xc-2.rs
issue-13641.rs
issue-13641.stderr
issue-17718-const-privacy.rs
issue-17718-const-privacy.stderr
issue-29161.rs
issue-29161.stderr
issue-30079.rs
issue-30079.stderr
issue-46209-private-enum-variant-reexport.rs
issue-46209-private-enum-variant-reexport.stderr
issue-57264-1.rs
issue-57264-2.rs
issue-75062-fieldless-tuple-struct.rs
issue-75062-fieldless-tuple-struct.stderr
issue-75906.rs
issue-75906.stderr
issue-75907_b.rs
issue-75907_b.stderr
issue-75907.rs
issue-75907.stderr
issue-79593.rs
issue-79593.stderr
issue-92755.rs
issue-111220-2-tuple-struct-fields-projection.rs fix for Self not respecting tuple Ctor privacy 2023-05-26 06:23:03 +00:00
issue-111220-2-tuple-struct-fields-projection.stderr fix for Self not respecting tuple Ctor privacy 2023-05-26 06:23:03 +00:00
issue-111220-tuple-struct-fields.rs fix for Self not respecting tuple Ctor privacy 2023-05-26 06:23:03 +00:00
issue-111220-tuple-struct-fields.stderr fix for Self not respecting tuple Ctor privacy 2023-05-26 06:23:03 +00:00
legacy-ctor-visibility.rs
legacy-ctor-visibility.stderr
macro-private-reexport.rs
macro-private-reexport.stderr
priv-impl-prim-ty.rs
priv-in-bad-locations.rs
priv-in-bad-locations.stderr
privacy1-rpass.rs
privacy1.rs
privacy1.stderr Tweak privacy errors to account for reachable items 2023-06-22 16:50:31 +00:00
privacy2.rs
privacy2.stderr Leave it to the query system to invoke the typeck query instead of invoking it eagerly. 2023-04-21 22:12:45 +00:00
privacy3.rs
privacy3.stderr Leave it to the query system to invoke the typeck query instead of invoking it eagerly. 2023-04-21 22:12:45 +00:00
privacy4.rs
privacy4.stderr
privacy5.rs
privacy5.stderr
privacy-in-paths.rs
privacy-in-paths.stderr Tweak privacy errors to account for reachable items 2023-06-22 16:50:31 +00:00
privacy-ns1.rs
privacy-ns1.stderr
privacy-ns2.rs
privacy-ns2.stderr
privacy-ns.rs
privacy-reexport.rs
privacy-sanity.rs
privacy-sanity.stderr
privacy-ufcs.rs
privacy-ufcs.stderr Tweak privacy errors to account for reachable items 2023-06-22 16:50:31 +00:00
private-class-field.rs
private-field-ty-err.rs
private-field-ty-err.stderr
private-impl-method.rs
private-impl-method.stderr
private-in-public-assoc-ty.rs
private-in-public-assoc-ty.stderr
private-in-public-expr-pat.rs
private-in-public-ill-formed.rs
private-in-public-ill-formed.stderr
private-in-public-lint.rs
private-in-public-lint.stderr
private-in-public-non-principal-2.rs
private-in-public-non-principal-2.stderr
private-in-public-non-principal.rs Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
private-in-public-non-principal.stderr Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
private-in-public-type-alias-impl-trait.rs
private-in-public-warn.rs
private-in-public-warn.stderr
private-in-public.rs
private-in-public.stderr
private-inferred-type-1.rs Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
private-inferred-type-1.stderr Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
private-inferred-type-2.rs
private-inferred-type-2.stderr
private-inferred-type-3.rs
private-inferred-type-3.stderr
private-inferred-type.rs
private-inferred-type.stderr
private-item-simple.rs
private-item-simple.stderr
private-method-cross-crate.rs
private-method-cross-crate.stderr
private-method-inherited.rs
private-method-inherited.stderr
private-method-rpass.rs
private-method.rs
private-method.stderr
private-struct-field-cross-crate.rs
private-struct-field-cross-crate.stderr
private-struct-field-ctor.rs
private-struct-field-ctor.stderr
private-struct-field-pattern.rs
private-struct-field-pattern.stderr
private-struct-field.rs
private-struct-field.stderr
private-type-in-interface.rs
private-type-in-interface.stderr
private-variant-reexport.rs
private-variant-reexport.stderr
pub_use_mods_xcrate_exe.rs
pub-extern-privacy.rs
pub-use-xcrate.rs
reachable-unnameable-items.rs
suggest-making-field-public.fixed
suggest-making-field-public.rs
suggest-making-field-public.stderr
union-field-privacy-1.rs
union-field-privacy-1.stderr
union-field-privacy-2.rs
union-field-privacy-2.stderr
unnameable_types.rs Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
unnameable_types.stderr Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
useless-pub.rs
useless-pub.stderr
where-priv-type.rs Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
where-priv-type.stderr Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
where-pub-type-impls-priv-trait.rs Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
where-pub-type-impls-priv-trait.stderr Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
xc-private-method2.rs
xc-private-method2.stderr
xc-private-method.rs
xc-private-method.stderr