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 Move some UI tests into subdirectories 2023-04-02 19:42:30 -04:00
pub-priv-dep Move /src/test to /tests 2023-01-11 09:32:08 +00:00
restricted diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
sealed-traits Tweak privacy errors to account for reachable items 2023-06-22 16:50:31 +00:00
associated-item-privacy-inherent.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-item-privacy-inherent.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-item-privacy-trait.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-item-privacy-trait.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-item-privacy-type-binding.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-item-privacy-type-binding.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
crate-private-reexport.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
crate-private-reexport.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ctor.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
decl-macro.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
decl-macro.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
effective_visibilities_glob.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
effective_visibilities_invariants.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
effective_visibilities_invariants.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
effective_visibilities.rs resolve: Restore some effective visibility optimizations 2023-03-31 17:07:59 +04:00
effective_visibilities.stderr resolve: Restore some effective visibility optimizations 2023-03-31 17:07:59 +04:00
export-tag-variant.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-13641.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-13641.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-17718-const-privacy.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-17718-const-privacy.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-29161.rs Update ui tests involving invalid visibility qualifiers 2023-04-03 22:28:55 -05:00
issue-29161.stderr Update ui tests involving invalid visibility qualifiers 2023-04-03 22:28:55 -05:00
issue-30079.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-30079.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-46209-private-enum-variant-reexport.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-46209-private-enum-variant-reexport.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-57264-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-57264-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-75062-fieldless-tuple-struct.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-75062-fieldless-tuple-struct.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-75906.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-75906.stderr Suggest making private tuple struct field public 2023-01-11 21:35:42 +00:00
issue-75907_b.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-75907_b.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-75907.rs Suggest making private tuple struct field public 2023-01-11 21:35:42 +00:00
issue-75907.stderr Suggest making private tuple struct field public 2023-01-11 21:35:42 +00:00
issue-79593.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-79593.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-92755.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
legacy-ctor-visibility.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
macro-private-reexport.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
macro-private-reexport.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
priv-impl-prim-ty.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
priv-in-bad-locations.rs Update ui tests involving invalid visibility qualifiers 2023-04-03 22:28:55 -05:00
priv-in-bad-locations.stderr Update ui tests involving invalid visibility qualifiers 2023-04-03 22:28:55 -05:00
privacy1-rpass.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
privacy1.rs diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
privacy1.stderr Tweak privacy errors to account for reachable items 2023-06-22 16:50:31 +00:00
privacy2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
privacy4.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
privacy5.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
privacy5.stderr review comments: Tweak output 2023-01-11 21:36:02 +00:00
privacy-in-paths.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
privacy-in-paths.stderr Tweak privacy errors to account for reachable items 2023-06-22 16:50:31 +00:00
privacy-ns1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
privacy-ns1.stderr Special-case item attributes in the suggestion output 2023-04-12 22:50:10 +00:00
privacy-ns2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
privacy-ns2.stderr Special-case item attributes in the suggestion output 2023-04-12 22:50:10 +00:00
privacy-ns.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
privacy-reexport.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
privacy-sanity.rs Update ui tests involving invalid visibility qualifiers 2023-04-03 22:28:55 -05:00
privacy-sanity.stderr Update ui tests involving invalid visibility qualifiers 2023-04-03 22:28:55 -05:00
privacy-ufcs.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
privacy-ufcs.stderr Tweak privacy errors to account for reachable items 2023-06-22 16:50:31 +00:00
private-class-field.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-field-ty-err.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-field-ty-err.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-impl-method.rs diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
private-impl-method.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
private-in-public-assoc-ty.rs Split out a separate feature gate for impl trait in associated types 2023-04-12 16:17:31 +00:00
private-in-public-assoc-ty.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-in-public-expr-pat.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-in-public-ill-formed.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-in-public-ill-formed.stderr Tighter spans for bad inherent impl types 2023-02-13 18:41:18 +00:00
private-in-public-lint.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-in-public-lint.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-in-public-non-principal-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-in-public-non-principal-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Split out a separate feature gate for impl trait in associated types 2023-04-12 16:17:31 +00:00
private-in-public-warn.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-in-public-warn.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-in-public.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-in-public.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-inferred-type-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-inferred-type-3.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-inferred-type-3.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-inferred-type.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-inferred-type.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-item-simple.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-item-simple.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-method-cross-crate.rs diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
private-method-cross-crate.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
private-method-inherited.rs diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
private-method-inherited.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
private-method-rpass.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-method.rs diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
private-method.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
private-struct-field-cross-crate.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-struct-field-cross-crate.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-struct-field-ctor.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-struct-field-ctor.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-struct-field-pattern.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-struct-field-pattern.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-struct-field.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-struct-field.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-type-in-interface.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-type-in-interface.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-variant-reexport.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
private-variant-reexport.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
pub_use_mods_xcrate_exe.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
pub-extern-privacy.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
pub-use-xcrate.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
reachable-unnameable-items.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggest-making-field-public.fixed review comments: Tweak output 2023-01-11 21:36:02 +00:00
suggest-making-field-public.rs review comments: Tweak output 2023-01-11 21:36:02 +00:00
suggest-making-field-public.stderr review comments: Tweak output 2023-01-11 21:36:02 +00:00
union-field-privacy-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
union-field-privacy-1.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
union-field-privacy-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
union-field-privacy-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Update ui tests involving invalid visibility qualifiers 2023-04-03 22:28:55 -05:00
useless-pub.stderr Update ui tests involving invalid visibility qualifiers 2023-04-03 22:28:55 -05:00
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 Move some UI tests into subdirectories 2023-04-02 19:42:30 -04:00
xc-private-method2.stderr Move some UI tests into subdirectories 2023-04-02 19:42:30 -04:00
xc-private-method.rs Move some UI tests into subdirectories 2023-04-02 19:42:30 -04:00
xc-private-method.stderr Move some UI tests into subdirectories 2023-04-02 19:42:30 -04:00