diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/privacy/associated-item-privacy-inherent.rs (renamed from src/test/ui/privacy/associated-item-privacy-inherent.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/associated-item-privacy-inherent.stderr (renamed from src/test/ui/privacy/associated-item-privacy-inherent.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/associated-item-privacy-trait.rs (renamed from src/test/ui/privacy/associated-item-privacy-trait.rs) | 4 | ||||
-rw-r--r-- | tests/ui/privacy/associated-item-privacy-trait.stderr (renamed from src/test/ui/privacy/associated-item-privacy-trait.stderr) | 4 | ||||
-rw-r--r-- | tests/ui/privacy/associated-item-privacy-type-binding.rs (renamed from src/test/ui/privacy/associated-item-privacy-type-binding.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/associated-item-privacy-type-binding.stderr (renamed from src/test/ui/privacy/associated-item-privacy-type-binding.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/cci_class.rs (renamed from src/test/ui/privacy/auxiliary/cci_class.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/cci_class_5.rs (renamed from src/test/ui/privacy/auxiliary/cci_class_5.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/ctor_aux.rs (renamed from src/test/ui/privacy/auxiliary/ctor_aux.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/impl_privacy_xc_2.rs (renamed from src/test/ui/privacy/auxiliary/impl_privacy_xc_2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/issue-17718-const-privacy.rs (renamed from src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/issue-57264-1.rs (renamed from src/test/ui/privacy/auxiliary/issue-57264-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/issue-57264-2.rs (renamed from src/test/ui/privacy/auxiliary/issue-57264-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/issue-75907.rs (renamed from src/test/ui/privacy/auxiliary/issue-75907.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/issue-92755.rs (renamed from src/test/ui/privacy/auxiliary/issue-92755.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/priv-impl-prim-ty.rs (renamed from src/test/ui/privacy/auxiliary/priv-impl-prim-ty.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/privacy_reexport.rs (renamed from src/test/ui/privacy/auxiliary/privacy_reexport.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/privacy_tuple_struct.rs (renamed from src/test/ui/privacy/auxiliary/privacy_tuple_struct.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/private-inferred-type.rs (renamed from src/test/ui/privacy/auxiliary/private-inferred-type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/pub_use_mods_xcrate.rs (renamed from src/test/ui/privacy/auxiliary/pub_use_mods_xcrate.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/pub_use_xcrate1.rs (renamed from src/test/ui/privacy/auxiliary/pub_use_xcrate1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/pub_use_xcrate2.rs (renamed from src/test/ui/privacy/auxiliary/pub_use_xcrate2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/auxiliary/reachable-unnameable-items.rs (renamed from src/test/ui/privacy/auxiliary/reachable-unnameable-items.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/crate-private-reexport.rs (renamed from src/test/ui/privacy/crate-private-reexport.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/crate-private-reexport.stderr (renamed from src/test/ui/privacy/crate-private-reexport.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/ctor.rs (renamed from src/test/ui/privacy/ctor.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/decl-macro.rs (renamed from src/test/ui/privacy/decl-macro.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/decl-macro.stderr (renamed from src/test/ui/privacy/decl-macro.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/effective_visibilities.rs (renamed from src/test/ui/privacy/effective_visibilities.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/effective_visibilities.stderr (renamed from src/test/ui/privacy/effective_visibilities.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/effective_visibilities_glob.rs (renamed from src/test/ui/privacy/effective_visibilities_glob.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/effective_visibilities_glob.stderr (renamed from src/test/ui/privacy/effective_visibilities_glob.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/effective_visibilities_invariants.rs (renamed from src/test/ui/privacy/effective_visibilities_invariants.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/effective_visibilities_invariants.stderr (renamed from src/test/ui/privacy/effective_visibilities_invariants.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/export-tag-variant.rs (renamed from src/test/ui/privacy/export-tag-variant.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/export-tag-variant.stderr (renamed from src/test/ui/privacy/export-tag-variant.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/impl-privacy-xc-2.rs (renamed from src/test/ui/privacy/impl-privacy-xc-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-13641.rs (renamed from src/test/ui/privacy/issue-13641.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-13641.stderr (renamed from src/test/ui/privacy/issue-13641.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-17718-const-privacy.rs (renamed from src/test/ui/privacy/issue-17718-const-privacy.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-17718-const-privacy.stderr (renamed from src/test/ui/privacy/issue-17718-const-privacy.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-29161.rs (renamed from src/test/ui/privacy/issue-29161.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-29161.stderr (renamed from src/test/ui/privacy/issue-29161.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-30079.rs (renamed from src/test/ui/privacy/issue-30079.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-30079.stderr (renamed from src/test/ui/privacy/issue-30079.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-46209-private-enum-variant-reexport.rs (renamed from src/test/ui/privacy/issue-46209-private-enum-variant-reexport.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-46209-private-enum-variant-reexport.stderr (renamed from src/test/ui/privacy/issue-46209-private-enum-variant-reexport.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-57264-1.rs (renamed from src/test/ui/privacy/issue-57264-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-57264-2.rs (renamed from src/test/ui/privacy/issue-57264-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-75062-fieldless-tuple-struct.rs (renamed from src/test/ui/privacy/issue-75062-fieldless-tuple-struct.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-75062-fieldless-tuple-struct.stderr (renamed from src/test/ui/privacy/issue-75062-fieldless-tuple-struct.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-75906.rs (renamed from src/test/ui/privacy/issue-75906.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-75906.stderr (renamed from src/test/ui/privacy/issue-75906.stderr) | 4 | ||||
-rw-r--r-- | tests/ui/privacy/issue-75907.rs (renamed from src/test/ui/privacy/issue-75907.rs) | 2 | ||||
-rw-r--r-- | tests/ui/privacy/issue-75907.stderr (renamed from src/test/ui/privacy/issue-75907.stderr) | 8 | ||||
-rw-r--r-- | tests/ui/privacy/issue-75907_b.rs (renamed from src/test/ui/privacy/issue-75907_b.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-75907_b.stderr (renamed from src/test/ui/privacy/issue-75907_b.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-79593.rs (renamed from src/test/ui/privacy/issue-79593.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-79593.stderr (renamed from src/test/ui/privacy/issue-79593.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/issue-92755.rs (renamed from src/test/ui/privacy/issue-92755.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/legacy-ctor-visibility.rs (renamed from src/test/ui/privacy/legacy-ctor-visibility.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/legacy-ctor-visibility.stderr (renamed from src/test/ui/privacy/legacy-ctor-visibility.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/macro-private-reexport.rs (renamed from src/test/ui/privacy/macro-private-reexport.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/macro-private-reexport.stderr (renamed from src/test/ui/privacy/macro-private-reexport.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/priv-impl-prim-ty.rs (renamed from src/test/ui/privacy/priv-impl-prim-ty.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/priv-in-bad-locations.rs (renamed from src/test/ui/privacy/priv-in-bad-locations.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/priv-in-bad-locations.stderr (renamed from src/test/ui/privacy/priv-in-bad-locations.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-in-paths.rs (renamed from src/test/ui/privacy/privacy-in-paths.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-in-paths.stderr (renamed from src/test/ui/privacy/privacy-in-paths.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-ns.rs (renamed from src/test/ui/privacy/privacy-ns.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-ns1.rs (renamed from src/test/ui/privacy/privacy-ns1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-ns1.stderr (renamed from src/test/ui/privacy/privacy-ns1.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-ns2.rs (renamed from src/test/ui/privacy/privacy-ns2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-ns2.stderr (renamed from src/test/ui/privacy/privacy-ns2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-reexport.rs (renamed from src/test/ui/privacy/privacy-reexport.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-sanity.rs (renamed from src/test/ui/privacy/privacy-sanity.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-sanity.stderr (renamed from src/test/ui/privacy/privacy-sanity.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-ufcs.rs (renamed from src/test/ui/privacy/privacy-ufcs.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy-ufcs.stderr (renamed from src/test/ui/privacy/privacy-ufcs.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy1-rpass.rs (renamed from src/test/ui/privacy/privacy1-rpass.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy1.rs (renamed from src/test/ui/privacy/privacy1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy1.stderr (renamed from src/test/ui/privacy/privacy1.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy2.rs (renamed from src/test/ui/privacy/privacy2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy2.stderr (renamed from src/test/ui/privacy/privacy2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy3.rs (renamed from src/test/ui/privacy/privacy3.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy3.stderr (renamed from src/test/ui/privacy/privacy3.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy4.rs (renamed from src/test/ui/privacy/privacy4.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy4.stderr (renamed from src/test/ui/privacy/privacy4.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy5.rs (renamed from src/test/ui/privacy/privacy5.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/privacy5.stderr (renamed from src/test/ui/privacy/privacy5.stderr) | 96 | ||||
-rw-r--r-- | tests/ui/privacy/private-class-field.rs (renamed from src/test/ui/privacy/private-class-field.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-field-ty-err.rs | 20 | ||||
-rw-r--r-- | tests/ui/privacy/private-field-ty-err.stderr | 9 | ||||
-rw-r--r-- | tests/ui/privacy/private-impl-method.rs (renamed from src/test/ui/privacy/private-impl-method.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-impl-method.stderr (renamed from src/test/ui/privacy/private-impl-method.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-assoc-ty.rs (renamed from src/test/ui/privacy/private-in-public-assoc-ty.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-assoc-ty.stderr (renamed from src/test/ui/privacy/private-in-public-assoc-ty.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-expr-pat.rs (renamed from src/test/ui/privacy/private-in-public-expr-pat.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-ill-formed.rs (renamed from src/test/ui/privacy/private-in-public-ill-formed.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-ill-formed.stderr (renamed from src/test/ui/privacy/private-in-public-ill-formed.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-lint.rs (renamed from src/test/ui/privacy/private-in-public-lint.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-lint.stderr (renamed from src/test/ui/privacy/private-in-public-lint.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-non-principal-2.rs (renamed from src/test/ui/privacy/private-in-public-non-principal-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-non-principal-2.stderr (renamed from src/test/ui/privacy/private-in-public-non-principal-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-non-principal.rs (renamed from src/test/ui/privacy/private-in-public-non-principal.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-non-principal.stderr (renamed from src/test/ui/privacy/private-in-public-non-principal.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-type-alias-impl-trait.rs (renamed from src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-warn.rs (renamed from src/test/ui/privacy/private-in-public-warn.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public-warn.stderr (renamed from src/test/ui/privacy/private-in-public-warn.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public.rs (renamed from src/test/ui/privacy/private-in-public.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-in-public.stderr (renamed from src/test/ui/privacy/private-in-public.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-inferred-type-1.rs (renamed from src/test/ui/privacy/private-inferred-type-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-inferred-type-1.stderr (renamed from src/test/ui/privacy/private-inferred-type-1.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-inferred-type-2.rs (renamed from src/test/ui/privacy/private-inferred-type-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-inferred-type-2.stderr (renamed from src/test/ui/privacy/private-inferred-type-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-inferred-type-3.rs (renamed from src/test/ui/privacy/private-inferred-type-3.rs) | 2 | ||||
-rw-r--r-- | tests/ui/privacy/private-inferred-type-3.stderr (renamed from src/test/ui/privacy/private-inferred-type-3.stderr) | 2 | ||||
-rw-r--r-- | tests/ui/privacy/private-inferred-type.rs (renamed from src/test/ui/privacy/private-inferred-type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-inferred-type.stderr (renamed from src/test/ui/privacy/private-inferred-type.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-item-simple.rs (renamed from src/test/ui/privacy/private-item-simple.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-item-simple.stderr (renamed from src/test/ui/privacy/private-item-simple.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-method-cross-crate.rs (renamed from src/test/ui/privacy/private-method-cross-crate.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-method-cross-crate.stderr (renamed from src/test/ui/privacy/private-method-cross-crate.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-method-inherited.rs (renamed from src/test/ui/privacy/private-method-inherited.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-method-inherited.stderr (renamed from src/test/ui/privacy/private-method-inherited.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-method-rpass.rs (renamed from src/test/ui/privacy/private-method-rpass.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-method.rs (renamed from src/test/ui/privacy/private-method.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-method.stderr (renamed from src/test/ui/privacy/private-method.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-struct-field-cross-crate.rs (renamed from src/test/ui/privacy/private-struct-field-cross-crate.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-struct-field-cross-crate.stderr (renamed from src/test/ui/privacy/private-struct-field-cross-crate.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-struct-field-ctor.rs (renamed from src/test/ui/privacy/private-struct-field-ctor.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-struct-field-ctor.stderr (renamed from src/test/ui/privacy/private-struct-field-ctor.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-struct-field-pattern.rs (renamed from src/test/ui/privacy/private-struct-field-pattern.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-struct-field-pattern.stderr (renamed from src/test/ui/privacy/private-struct-field-pattern.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-struct-field.rs (renamed from src/test/ui/privacy/private-struct-field.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-struct-field.stderr (renamed from src/test/ui/privacy/private-struct-field.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-type-in-interface.rs (renamed from src/test/ui/privacy/private-type-in-interface.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-type-in-interface.stderr (renamed from src/test/ui/privacy/private-type-in-interface.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-variant-reexport.rs (renamed from src/test/ui/privacy/private-variant-reexport.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/private-variant-reexport.stderr (renamed from src/test/ui/privacy/private-variant-reexport.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/pub-extern-privacy.rs (renamed from src/test/ui/privacy/pub-extern-privacy.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/pub-priv-dep/auxiliary/priv_dep.rs (renamed from src/test/ui/privacy/pub-priv-dep/auxiliary/priv_dep.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/pub-priv-dep/auxiliary/pub_dep.rs (renamed from src/test/ui/privacy/pub-priv-dep/auxiliary/pub_dep.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/pub-priv-dep/pub-priv1.rs (renamed from src/test/ui/privacy/pub-priv-dep/pub-priv1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/pub-priv-dep/pub-priv1.stderr (renamed from src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/pub-priv-dep/std-pub.rs (renamed from src/test/ui/privacy/pub-priv-dep/std-pub.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/pub-use-xcrate.rs (renamed from src/test/ui/privacy/pub-use-xcrate.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/pub_use_mods_xcrate_exe.rs (renamed from src/test/ui/privacy/pub_use_mods_xcrate_exe.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/reachable-unnameable-items.rs (renamed from src/test/ui/privacy/reachable-unnameable-items.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/restricted/auxiliary/pub_restricted.rs (renamed from src/test/ui/privacy/restricted/auxiliary/pub_restricted.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/restricted/lookup-ignores-private.rs (renamed from src/test/ui/privacy/restricted/lookup-ignores-private.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/restricted/private-in-public.rs (renamed from src/test/ui/privacy/restricted/private-in-public.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/restricted/private-in-public.stderr (renamed from src/test/ui/privacy/restricted/private-in-public.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/restricted/relative-2018.rs (renamed from src/test/ui/privacy/restricted/relative-2018.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/restricted/relative-2018.stderr (renamed from src/test/ui/privacy/restricted/relative-2018.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/restricted/struct-literal-field.rs (renamed from src/test/ui/privacy/restricted/struct-literal-field.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/restricted/struct-literal-field.stderr (renamed from src/test/ui/privacy/restricted/struct-literal-field.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/restricted/test.rs (renamed from src/test/ui/privacy/restricted/test.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/restricted/test.stderr (renamed from src/test/ui/privacy/restricted/test.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/suggest-making-field-public.fixed | 15 | ||||
-rw-r--r-- | tests/ui/privacy/suggest-making-field-public.rs | 15 | ||||
-rw-r--r-- | tests/ui/privacy/suggest-making-field-public.stderr | 39 | ||||
-rw-r--r-- | tests/ui/privacy/union-field-privacy-1.rs (renamed from src/test/ui/privacy/union-field-privacy-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/union-field-privacy-1.stderr (renamed from src/test/ui/privacy/union-field-privacy-1.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/union-field-privacy-2.rs (renamed from src/test/ui/privacy/union-field-privacy-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/union-field-privacy-2.stderr (renamed from src/test/ui/privacy/union-field-privacy-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/useless-pub.rs (renamed from src/test/ui/privacy/useless-pub.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/useless-pub.stderr (renamed from src/test/ui/privacy/useless-pub.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/where-priv-type.rs (renamed from src/test/ui/privacy/where-priv-type.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/where-priv-type.stderr (renamed from src/test/ui/privacy/where-priv-type.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/where-pub-type-impls-priv-trait.rs (renamed from src/test/ui/privacy/where-pub-type-impls-priv-trait.rs) | 0 | ||||
-rw-r--r-- | tests/ui/privacy/where-pub-type-impls-priv-trait.stderr (renamed from src/test/ui/privacy/where-pub-type-impls-priv-trait.stderr) | 0 |
172 files changed, 213 insertions, 7 deletions
diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.rs b/tests/ui/privacy/associated-item-privacy-inherent.rs index 7b7c734a9..7b7c734a9 100644 --- a/src/test/ui/privacy/associated-item-privacy-inherent.rs +++ b/tests/ui/privacy/associated-item-privacy-inherent.rs diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.stderr b/tests/ui/privacy/associated-item-privacy-inherent.stderr index f4d4ee459..f4d4ee459 100644 --- a/src/test/ui/privacy/associated-item-privacy-inherent.stderr +++ b/tests/ui/privacy/associated-item-privacy-inherent.stderr diff --git a/src/test/ui/privacy/associated-item-privacy-trait.rs b/tests/ui/privacy/associated-item-privacy-trait.rs index ad9a5e15c..c686a2177 100644 --- a/src/test/ui/privacy/associated-item-privacy-trait.rs +++ b/tests/ui/privacy/associated-item-privacy-trait.rs @@ -19,9 +19,9 @@ mod priv_trait { Pub.method(); //~^ ERROR type `for<'a> fn(&'a Self) {<Self as PrivTr>::method}` is private <Pub as PrivTr>::CONST; - //~^ ERROR associated constant `<Pub as PrivTr>::CONST` is private + //~^ ERROR associated constant `PrivTr::CONST` is private let _: <Pub as PrivTr>::AssocTy; - //~^ ERROR associated type `<Pub as PrivTr>::AssocTy` is private + //~^ ERROR associated type `PrivTr::AssocTy` is private pub type InSignatureTy = <Pub as PrivTr>::AssocTy; //~^ ERROR trait `PrivTr` is private pub trait InSignatureTr: PrivTr {} diff --git a/src/test/ui/privacy/associated-item-privacy-trait.stderr b/tests/ui/privacy/associated-item-privacy-trait.stderr index c4be1a9d9..eb905bf7e 100644 --- a/src/test/ui/privacy/associated-item-privacy-trait.stderr +++ b/tests/ui/privacy/associated-item-privacy-trait.stderr @@ -31,7 +31,7 @@ LL | priv_trait::mac!(); | = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: associated constant `<Pub as PrivTr>::CONST` is private +error: associated constant `PrivTr::CONST` is private --> $DIR/associated-item-privacy-trait.rs:21:9 | LL | <Pub as PrivTr>::CONST; @@ -42,7 +42,7 @@ LL | priv_trait::mac!(); | = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: associated type `<Pub as PrivTr>::AssocTy` is private +error: associated type `PrivTr::AssocTy` is private --> $DIR/associated-item-privacy-trait.rs:23:16 | LL | let _: <Pub as PrivTr>::AssocTy; diff --git a/src/test/ui/privacy/associated-item-privacy-type-binding.rs b/tests/ui/privacy/associated-item-privacy-type-binding.rs index 9826b83a3..9826b83a3 100644 --- a/src/test/ui/privacy/associated-item-privacy-type-binding.rs +++ b/tests/ui/privacy/associated-item-privacy-type-binding.rs diff --git a/src/test/ui/privacy/associated-item-privacy-type-binding.stderr b/tests/ui/privacy/associated-item-privacy-type-binding.stderr index de9893816..de9893816 100644 --- a/src/test/ui/privacy/associated-item-privacy-type-binding.stderr +++ b/tests/ui/privacy/associated-item-privacy-type-binding.stderr diff --git a/src/test/ui/privacy/auxiliary/cci_class.rs b/tests/ui/privacy/auxiliary/cci_class.rs index de2945d74..de2945d74 100644 --- a/src/test/ui/privacy/auxiliary/cci_class.rs +++ b/tests/ui/privacy/auxiliary/cci_class.rs diff --git a/src/test/ui/privacy/auxiliary/cci_class_5.rs b/tests/ui/privacy/auxiliary/cci_class_5.rs index 3aeaa83d3..3aeaa83d3 100644 --- a/src/test/ui/privacy/auxiliary/cci_class_5.rs +++ b/tests/ui/privacy/auxiliary/cci_class_5.rs diff --git a/src/test/ui/privacy/auxiliary/ctor_aux.rs b/tests/ui/privacy/auxiliary/ctor_aux.rs index 9c99cca9a..9c99cca9a 100644 --- a/src/test/ui/privacy/auxiliary/ctor_aux.rs +++ b/tests/ui/privacy/auxiliary/ctor_aux.rs diff --git a/src/test/ui/privacy/auxiliary/impl_privacy_xc_2.rs b/tests/ui/privacy/auxiliary/impl_privacy_xc_2.rs index 5f9c22681..5f9c22681 100644 --- a/src/test/ui/privacy/auxiliary/impl_privacy_xc_2.rs +++ b/tests/ui/privacy/auxiliary/impl_privacy_xc_2.rs diff --git a/src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs b/tests/ui/privacy/auxiliary/issue-17718-const-privacy.rs index 93cf4bf3e..93cf4bf3e 100644 --- a/src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs +++ b/tests/ui/privacy/auxiliary/issue-17718-const-privacy.rs diff --git a/src/test/ui/privacy/auxiliary/issue-57264-1.rs b/tests/ui/privacy/auxiliary/issue-57264-1.rs index 9302fa0d9..9302fa0d9 100644 --- a/src/test/ui/privacy/auxiliary/issue-57264-1.rs +++ b/tests/ui/privacy/auxiliary/issue-57264-1.rs diff --git a/src/test/ui/privacy/auxiliary/issue-57264-2.rs b/tests/ui/privacy/auxiliary/issue-57264-2.rs index 416206b4f..416206b4f 100644 --- a/src/test/ui/privacy/auxiliary/issue-57264-2.rs +++ b/tests/ui/privacy/auxiliary/issue-57264-2.rs diff --git a/src/test/ui/privacy/auxiliary/issue-75907.rs b/tests/ui/privacy/auxiliary/issue-75907.rs index 389c9c351..389c9c351 100644 --- a/src/test/ui/privacy/auxiliary/issue-75907.rs +++ b/tests/ui/privacy/auxiliary/issue-75907.rs diff --git a/src/test/ui/privacy/auxiliary/issue-92755.rs b/tests/ui/privacy/auxiliary/issue-92755.rs index 6f8527346..6f8527346 100644 --- a/src/test/ui/privacy/auxiliary/issue-92755.rs +++ b/tests/ui/privacy/auxiliary/issue-92755.rs diff --git a/src/test/ui/privacy/auxiliary/priv-impl-prim-ty.rs b/tests/ui/privacy/auxiliary/priv-impl-prim-ty.rs index 8ccbd3f12..8ccbd3f12 100644 --- a/src/test/ui/privacy/auxiliary/priv-impl-prim-ty.rs +++ b/tests/ui/privacy/auxiliary/priv-impl-prim-ty.rs diff --git a/src/test/ui/privacy/auxiliary/privacy_reexport.rs b/tests/ui/privacy/auxiliary/privacy_reexport.rs index 6b72dbc92..6b72dbc92 100644 --- a/src/test/ui/privacy/auxiliary/privacy_reexport.rs +++ b/tests/ui/privacy/auxiliary/privacy_reexport.rs diff --git a/src/test/ui/privacy/auxiliary/privacy_tuple_struct.rs b/tests/ui/privacy/auxiliary/privacy_tuple_struct.rs index 223cda4b2..223cda4b2 100644 --- a/src/test/ui/privacy/auxiliary/privacy_tuple_struct.rs +++ b/tests/ui/privacy/auxiliary/privacy_tuple_struct.rs diff --git a/src/test/ui/privacy/auxiliary/private-inferred-type.rs b/tests/ui/privacy/auxiliary/private-inferred-type.rs index 7ac913f5b..7ac913f5b 100644 --- a/src/test/ui/privacy/auxiliary/private-inferred-type.rs +++ b/tests/ui/privacy/auxiliary/private-inferred-type.rs diff --git a/src/test/ui/privacy/auxiliary/pub_use_mods_xcrate.rs b/tests/ui/privacy/auxiliary/pub_use_mods_xcrate.rs index 74d3504d5..74d3504d5 100644 --- a/src/test/ui/privacy/auxiliary/pub_use_mods_xcrate.rs +++ b/tests/ui/privacy/auxiliary/pub_use_mods_xcrate.rs diff --git a/src/test/ui/privacy/auxiliary/pub_use_xcrate1.rs b/tests/ui/privacy/auxiliary/pub_use_xcrate1.rs index 772c9627a..772c9627a 100644 --- a/src/test/ui/privacy/auxiliary/pub_use_xcrate1.rs +++ b/tests/ui/privacy/auxiliary/pub_use_xcrate1.rs diff --git a/src/test/ui/privacy/auxiliary/pub_use_xcrate2.rs b/tests/ui/privacy/auxiliary/pub_use_xcrate2.rs index 20d7066d3..20d7066d3 100644 --- a/src/test/ui/privacy/auxiliary/pub_use_xcrate2.rs +++ b/tests/ui/privacy/auxiliary/pub_use_xcrate2.rs diff --git a/src/test/ui/privacy/auxiliary/reachable-unnameable-items.rs b/tests/ui/privacy/auxiliary/reachable-unnameable-items.rs index 20f110b1a..20f110b1a 100644 --- a/src/test/ui/privacy/auxiliary/reachable-unnameable-items.rs +++ b/tests/ui/privacy/auxiliary/reachable-unnameable-items.rs diff --git a/src/test/ui/privacy/crate-private-reexport.rs b/tests/ui/privacy/crate-private-reexport.rs index fa4f88666..fa4f88666 100644 --- a/src/test/ui/privacy/crate-private-reexport.rs +++ b/tests/ui/privacy/crate-private-reexport.rs diff --git a/src/test/ui/privacy/crate-private-reexport.stderr b/tests/ui/privacy/crate-private-reexport.stderr index 66e11e821..66e11e821 100644 --- a/src/test/ui/privacy/crate-private-reexport.stderr +++ b/tests/ui/privacy/crate-private-reexport.stderr diff --git a/src/test/ui/privacy/ctor.rs b/tests/ui/privacy/ctor.rs index 0ec15d68e..0ec15d68e 100644 --- a/src/test/ui/privacy/ctor.rs +++ b/tests/ui/privacy/ctor.rs diff --git a/src/test/ui/privacy/decl-macro.rs b/tests/ui/privacy/decl-macro.rs index 1eb49bd53..1eb49bd53 100644 --- a/src/test/ui/privacy/decl-macro.rs +++ b/tests/ui/privacy/decl-macro.rs diff --git a/src/test/ui/privacy/decl-macro.stderr b/tests/ui/privacy/decl-macro.stderr index 5bc6f07ff..5bc6f07ff 100644 --- a/src/test/ui/privacy/decl-macro.stderr +++ b/tests/ui/privacy/decl-macro.stderr diff --git a/src/test/ui/privacy/effective_visibilities.rs b/tests/ui/privacy/effective_visibilities.rs index ff20e20d3..ff20e20d3 100644 --- a/src/test/ui/privacy/effective_visibilities.rs +++ b/tests/ui/privacy/effective_visibilities.rs diff --git a/src/test/ui/privacy/effective_visibilities.stderr b/tests/ui/privacy/effective_visibilities.stderr index 046b6095f..046b6095f 100644 --- a/src/test/ui/privacy/effective_visibilities.stderr +++ b/tests/ui/privacy/effective_visibilities.stderr diff --git a/src/test/ui/privacy/effective_visibilities_glob.rs b/tests/ui/privacy/effective_visibilities_glob.rs index eb9dcd6cd..eb9dcd6cd 100644 --- a/src/test/ui/privacy/effective_visibilities_glob.rs +++ b/tests/ui/privacy/effective_visibilities_glob.rs diff --git a/src/test/ui/privacy/effective_visibilities_glob.stderr b/tests/ui/privacy/effective_visibilities_glob.stderr index 0496cd5df..0496cd5df 100644 --- a/src/test/ui/privacy/effective_visibilities_glob.stderr +++ b/tests/ui/privacy/effective_visibilities_glob.stderr diff --git a/src/test/ui/privacy/effective_visibilities_invariants.rs b/tests/ui/privacy/effective_visibilities_invariants.rs index af5a2bed6..af5a2bed6 100644 --- a/src/test/ui/privacy/effective_visibilities_invariants.rs +++ b/tests/ui/privacy/effective_visibilities_invariants.rs diff --git a/src/test/ui/privacy/effective_visibilities_invariants.stderr b/tests/ui/privacy/effective_visibilities_invariants.stderr index fd205f405..fd205f405 100644 --- a/src/test/ui/privacy/effective_visibilities_invariants.stderr +++ b/tests/ui/privacy/effective_visibilities_invariants.stderr diff --git a/src/test/ui/privacy/export-tag-variant.rs b/tests/ui/privacy/export-tag-variant.rs index 46c10067c..46c10067c 100644 --- a/src/test/ui/privacy/export-tag-variant.rs +++ b/tests/ui/privacy/export-tag-variant.rs diff --git a/src/test/ui/privacy/export-tag-variant.stderr b/tests/ui/privacy/export-tag-variant.stderr index f73bd454d..f73bd454d 100644 --- a/src/test/ui/privacy/export-tag-variant.stderr +++ b/tests/ui/privacy/export-tag-variant.stderr diff --git a/src/test/ui/privacy/impl-privacy-xc-2.rs b/tests/ui/privacy/impl-privacy-xc-2.rs index 390764588..390764588 100644 --- a/src/test/ui/privacy/impl-privacy-xc-2.rs +++ b/tests/ui/privacy/impl-privacy-xc-2.rs diff --git a/src/test/ui/privacy/issue-13641.rs b/tests/ui/privacy/issue-13641.rs index 198cea428..198cea428 100644 --- a/src/test/ui/privacy/issue-13641.rs +++ b/tests/ui/privacy/issue-13641.rs diff --git a/src/test/ui/privacy/issue-13641.stderr b/tests/ui/privacy/issue-13641.stderr index cdd0772d3..cdd0772d3 100644 --- a/src/test/ui/privacy/issue-13641.stderr +++ b/tests/ui/privacy/issue-13641.stderr diff --git a/src/test/ui/privacy/issue-17718-const-privacy.rs b/tests/ui/privacy/issue-17718-const-privacy.rs index 6ab3a60df..6ab3a60df 100644 --- a/src/test/ui/privacy/issue-17718-const-privacy.rs +++ b/tests/ui/privacy/issue-17718-const-privacy.rs diff --git a/src/test/ui/privacy/issue-17718-const-privacy.stderr b/tests/ui/privacy/issue-17718-const-privacy.stderr index 133a6360b..133a6360b 100644 --- a/src/test/ui/privacy/issue-17718-const-privacy.stderr +++ b/tests/ui/privacy/issue-17718-const-privacy.stderr diff --git a/src/test/ui/privacy/issue-29161.rs b/tests/ui/privacy/issue-29161.rs index d80405aa8..d80405aa8 100644 --- a/src/test/ui/privacy/issue-29161.rs +++ b/tests/ui/privacy/issue-29161.rs diff --git a/src/test/ui/privacy/issue-29161.stderr b/tests/ui/privacy/issue-29161.stderr index 7ce95e4b0..7ce95e4b0 100644 --- a/src/test/ui/privacy/issue-29161.stderr +++ b/tests/ui/privacy/issue-29161.stderr diff --git a/src/test/ui/privacy/issue-30079.rs b/tests/ui/privacy/issue-30079.rs index a02a932d0..a02a932d0 100644 --- a/src/test/ui/privacy/issue-30079.rs +++ b/tests/ui/privacy/issue-30079.rs diff --git a/src/test/ui/privacy/issue-30079.stderr b/tests/ui/privacy/issue-30079.stderr index 9179ff339..9179ff339 100644 --- a/src/test/ui/privacy/issue-30079.stderr +++ b/tests/ui/privacy/issue-30079.stderr diff --git a/src/test/ui/privacy/issue-46209-private-enum-variant-reexport.rs b/tests/ui/privacy/issue-46209-private-enum-variant-reexport.rs index 6f115e78e..6f115e78e 100644 --- a/src/test/ui/privacy/issue-46209-private-enum-variant-reexport.rs +++ b/tests/ui/privacy/issue-46209-private-enum-variant-reexport.rs diff --git a/src/test/ui/privacy/issue-46209-private-enum-variant-reexport.stderr b/tests/ui/privacy/issue-46209-private-enum-variant-reexport.stderr index 59b181fab..59b181fab 100644 --- a/src/test/ui/privacy/issue-46209-private-enum-variant-reexport.stderr +++ b/tests/ui/privacy/issue-46209-private-enum-variant-reexport.stderr diff --git a/src/test/ui/privacy/issue-57264-1.rs b/tests/ui/privacy/issue-57264-1.rs index 59ebc4f54..59ebc4f54 100644 --- a/src/test/ui/privacy/issue-57264-1.rs +++ b/tests/ui/privacy/issue-57264-1.rs diff --git a/src/test/ui/privacy/issue-57264-2.rs b/tests/ui/privacy/issue-57264-2.rs index 36ce5fd3b..36ce5fd3b 100644 --- a/src/test/ui/privacy/issue-57264-2.rs +++ b/tests/ui/privacy/issue-57264-2.rs diff --git a/src/test/ui/privacy/issue-75062-fieldless-tuple-struct.rs b/tests/ui/privacy/issue-75062-fieldless-tuple-struct.rs index 4601a3d47..4601a3d47 100644 --- a/src/test/ui/privacy/issue-75062-fieldless-tuple-struct.rs +++ b/tests/ui/privacy/issue-75062-fieldless-tuple-struct.rs diff --git a/src/test/ui/privacy/issue-75062-fieldless-tuple-struct.stderr b/tests/ui/privacy/issue-75062-fieldless-tuple-struct.stderr index 14a12003e..14a12003e 100644 --- a/src/test/ui/privacy/issue-75062-fieldless-tuple-struct.stderr +++ b/tests/ui/privacy/issue-75062-fieldless-tuple-struct.stderr diff --git a/src/test/ui/privacy/issue-75906.rs b/tests/ui/privacy/issue-75906.rs index 710039d79..710039d79 100644 --- a/src/test/ui/privacy/issue-75906.rs +++ b/tests/ui/privacy/issue-75906.rs diff --git a/src/test/ui/privacy/issue-75906.stderr b/tests/ui/privacy/issue-75906.stderr index 4c6a68646..600dc7c87 100644 --- a/src/test/ui/privacy/issue-75906.stderr +++ b/tests/ui/privacy/issue-75906.stderr @@ -9,6 +9,10 @@ note: constructor is not visible here due to private fields | LL | pub struct Bar(u8); | ^^ private field +help: consider making the field publicly accessible + | +LL | pub struct Bar(pub u8); + | +++ error: aborting due to previous error diff --git a/src/test/ui/privacy/issue-75907.rs b/tests/ui/privacy/issue-75907.rs index 6da99cf64..3bed841d1 100644 --- a/src/test/ui/privacy/issue-75907.rs +++ b/tests/ui/privacy/issue-75907.rs @@ -2,7 +2,7 @@ mod foo { pub(crate) struct Foo(u8); - pub(crate) struct Bar(pub u8, u8, Foo); + pub(crate) struct Bar(pub u8, pub(in crate::foo) u8, Foo); pub(crate) fn make_bar() -> Bar { Bar(1, 12, Foo(10)) diff --git a/src/test/ui/privacy/issue-75907.stderr b/tests/ui/privacy/issue-75907.stderr index 2f89e31a3..f7cb874c2 100644 --- a/src/test/ui/privacy/issue-75907.stderr +++ b/tests/ui/privacy/issue-75907.stderr @@ -11,6 +11,10 @@ LL | let Bar(x, y, Foo(z)) = make_bar(); | ^ ^^^^^^ private field | | | private field +help: consider making the fields publicly accessible + | +LL | pub(crate) struct Bar(pub u8, pub u8, pub Foo); + | ~~~ ~~~ +++ error[E0532]: cannot match against a tuple struct which contains private fields --> $DIR/issue-75907.rs:15:19 @@ -23,6 +27,10 @@ note: constructor is not visible here due to private fields | LL | let Bar(x, y, Foo(z)) = make_bar(); | ^ private field +help: consider making the field publicly accessible + | +LL | pub(crate) struct Foo(pub u8); + | +++ error: aborting due to 2 previous errors diff --git a/src/test/ui/privacy/issue-75907_b.rs b/tests/ui/privacy/issue-75907_b.rs index fdfc5907c..fdfc5907c 100644 --- a/src/test/ui/privacy/issue-75907_b.rs +++ b/tests/ui/privacy/issue-75907_b.rs diff --git a/src/test/ui/privacy/issue-75907_b.stderr b/tests/ui/privacy/issue-75907_b.stderr index b82d08473..b82d08473 100644 --- a/src/test/ui/privacy/issue-75907_b.stderr +++ b/tests/ui/privacy/issue-75907_b.stderr diff --git a/src/test/ui/privacy/issue-79593.rs b/tests/ui/privacy/issue-79593.rs index 39c222f7c..39c222f7c 100644 --- a/src/test/ui/privacy/issue-79593.rs +++ b/tests/ui/privacy/issue-79593.rs diff --git a/src/test/ui/privacy/issue-79593.stderr b/tests/ui/privacy/issue-79593.stderr index 21ba760ad..21ba760ad 100644 --- a/src/test/ui/privacy/issue-79593.stderr +++ b/tests/ui/privacy/issue-79593.stderr diff --git a/src/test/ui/privacy/issue-92755.rs b/tests/ui/privacy/issue-92755.rs index 49559152b..49559152b 100644 --- a/src/test/ui/privacy/issue-92755.rs +++ b/tests/ui/privacy/issue-92755.rs diff --git a/src/test/ui/privacy/legacy-ctor-visibility.rs b/tests/ui/privacy/legacy-ctor-visibility.rs index 5732b6446..5732b6446 100644 --- a/src/test/ui/privacy/legacy-ctor-visibility.rs +++ b/tests/ui/privacy/legacy-ctor-visibility.rs diff --git a/src/test/ui/privacy/legacy-ctor-visibility.stderr b/tests/ui/privacy/legacy-ctor-visibility.stderr index c8057d85e..c8057d85e 100644 --- a/src/test/ui/privacy/legacy-ctor-visibility.stderr +++ b/tests/ui/privacy/legacy-ctor-visibility.stderr diff --git a/src/test/ui/privacy/macro-private-reexport.rs b/tests/ui/privacy/macro-private-reexport.rs index d0aab528e..d0aab528e 100644 --- a/src/test/ui/privacy/macro-private-reexport.rs +++ b/tests/ui/privacy/macro-private-reexport.rs diff --git a/src/test/ui/privacy/macro-private-reexport.stderr b/tests/ui/privacy/macro-private-reexport.stderr index b8768f361..b8768f361 100644 --- a/src/test/ui/privacy/macro-private-reexport.stderr +++ b/tests/ui/privacy/macro-private-reexport.stderr diff --git a/src/test/ui/privacy/priv-impl-prim-ty.rs b/tests/ui/privacy/priv-impl-prim-ty.rs index 5d6a6b64e..5d6a6b64e 100644 --- a/src/test/ui/privacy/priv-impl-prim-ty.rs +++ b/tests/ui/privacy/priv-impl-prim-ty.rs diff --git a/src/test/ui/privacy/priv-in-bad-locations.rs b/tests/ui/privacy/priv-in-bad-locations.rs index 76af8c6cd..76af8c6cd 100644 --- a/src/test/ui/privacy/priv-in-bad-locations.rs +++ b/tests/ui/privacy/priv-in-bad-locations.rs diff --git a/src/test/ui/privacy/priv-in-bad-locations.stderr b/tests/ui/privacy/priv-in-bad-locations.stderr index 75bd2fe47..75bd2fe47 100644 --- a/src/test/ui/privacy/priv-in-bad-locations.stderr +++ b/tests/ui/privacy/priv-in-bad-locations.stderr diff --git a/src/test/ui/privacy/privacy-in-paths.rs b/tests/ui/privacy/privacy-in-paths.rs index 9cee2b89d..9cee2b89d 100644 --- a/src/test/ui/privacy/privacy-in-paths.rs +++ b/tests/ui/privacy/privacy-in-paths.rs diff --git a/src/test/ui/privacy/privacy-in-paths.stderr b/tests/ui/privacy/privacy-in-paths.stderr index 2eb3ebb51..2eb3ebb51 100644 --- a/src/test/ui/privacy/privacy-in-paths.stderr +++ b/tests/ui/privacy/privacy-in-paths.stderr diff --git a/src/test/ui/privacy/privacy-ns.rs b/tests/ui/privacy/privacy-ns.rs index c32e3f178..c32e3f178 100644 --- a/src/test/ui/privacy/privacy-ns.rs +++ b/tests/ui/privacy/privacy-ns.rs diff --git a/src/test/ui/privacy/privacy-ns1.rs b/tests/ui/privacy/privacy-ns1.rs index 1af5b857e..1af5b857e 100644 --- a/src/test/ui/privacy/privacy-ns1.rs +++ b/tests/ui/privacy/privacy-ns1.rs diff --git a/src/test/ui/privacy/privacy-ns1.stderr b/tests/ui/privacy/privacy-ns1.stderr index 91bc84e70..91bc84e70 100644 --- a/src/test/ui/privacy/privacy-ns1.stderr +++ b/tests/ui/privacy/privacy-ns1.stderr diff --git a/src/test/ui/privacy/privacy-ns2.rs b/tests/ui/privacy/privacy-ns2.rs index 47035ef3a..47035ef3a 100644 --- a/src/test/ui/privacy/privacy-ns2.rs +++ b/tests/ui/privacy/privacy-ns2.rs diff --git a/src/test/ui/privacy/privacy-ns2.stderr b/tests/ui/privacy/privacy-ns2.stderr index 904e9013f..904e9013f 100644 --- a/src/test/ui/privacy/privacy-ns2.stderr +++ b/tests/ui/privacy/privacy-ns2.stderr diff --git a/src/test/ui/privacy/privacy-reexport.rs b/tests/ui/privacy/privacy-reexport.rs index b3ec3af04..b3ec3af04 100644 --- a/src/test/ui/privacy/privacy-reexport.rs +++ b/tests/ui/privacy/privacy-reexport.rs diff --git a/src/test/ui/privacy/privacy-sanity.rs b/tests/ui/privacy/privacy-sanity.rs index 8bbf1ab5d..8bbf1ab5d 100644 --- a/src/test/ui/privacy/privacy-sanity.rs +++ b/tests/ui/privacy/privacy-sanity.rs diff --git a/src/test/ui/privacy/privacy-sanity.stderr b/tests/ui/privacy/privacy-sanity.stderr index c92553fd1..c92553fd1 100644 --- a/src/test/ui/privacy/privacy-sanity.stderr +++ b/tests/ui/privacy/privacy-sanity.stderr diff --git a/src/test/ui/privacy/privacy-ufcs.rs b/tests/ui/privacy/privacy-ufcs.rs index fec7f4134..fec7f4134 100644 --- a/src/test/ui/privacy/privacy-ufcs.rs +++ b/tests/ui/privacy/privacy-ufcs.rs diff --git a/src/test/ui/privacy/privacy-ufcs.stderr b/tests/ui/privacy/privacy-ufcs.stderr index e93a458ce..e93a458ce 100644 --- a/src/test/ui/privacy/privacy-ufcs.stderr +++ b/tests/ui/privacy/privacy-ufcs.stderr diff --git a/src/test/ui/privacy/privacy1-rpass.rs b/tests/ui/privacy/privacy1-rpass.rs index 4e54780da..4e54780da 100644 --- a/src/test/ui/privacy/privacy1-rpass.rs +++ b/tests/ui/privacy/privacy1-rpass.rs diff --git a/src/test/ui/privacy/privacy1.rs b/tests/ui/privacy/privacy1.rs index 3c9fa983d..3c9fa983d 100644 --- a/src/test/ui/privacy/privacy1.rs +++ b/tests/ui/privacy/privacy1.rs diff --git a/src/test/ui/privacy/privacy1.stderr b/tests/ui/privacy/privacy1.stderr index 70e6fcb7a..70e6fcb7a 100644 --- a/src/test/ui/privacy/privacy1.stderr +++ b/tests/ui/privacy/privacy1.stderr diff --git a/src/test/ui/privacy/privacy2.rs b/tests/ui/privacy/privacy2.rs index c8fa436bd..c8fa436bd 100644 --- a/src/test/ui/privacy/privacy2.rs +++ b/tests/ui/privacy/privacy2.rs diff --git a/src/test/ui/privacy/privacy2.stderr b/tests/ui/privacy/privacy2.stderr index 882f31465..882f31465 100644 --- a/src/test/ui/privacy/privacy2.stderr +++ b/tests/ui/privacy/privacy2.stderr diff --git a/src/test/ui/privacy/privacy3.rs b/tests/ui/privacy/privacy3.rs index 5a7cd76a9..5a7cd76a9 100644 --- a/src/test/ui/privacy/privacy3.rs +++ b/tests/ui/privacy/privacy3.rs diff --git a/src/test/ui/privacy/privacy3.stderr b/tests/ui/privacy/privacy3.stderr index 42ce456d9..42ce456d9 100644 --- a/src/test/ui/privacy/privacy3.stderr +++ b/tests/ui/privacy/privacy3.stderr diff --git a/src/test/ui/privacy/privacy4.rs b/tests/ui/privacy/privacy4.rs index fa257b800..fa257b800 100644 --- a/src/test/ui/privacy/privacy4.rs +++ b/tests/ui/privacy/privacy4.rs diff --git a/src/test/ui/privacy/privacy4.stderr b/tests/ui/privacy/privacy4.stderr index 7552fa71a..7552fa71a 100644 --- a/src/test/ui/privacy/privacy4.stderr +++ b/tests/ui/privacy/privacy4.stderr diff --git a/src/test/ui/privacy/privacy5.rs b/tests/ui/privacy/privacy5.rs index 3dc26b195..3dc26b195 100644 --- a/src/test/ui/privacy/privacy5.rs +++ b/tests/ui/privacy/privacy5.rs diff --git a/src/test/ui/privacy/privacy5.stderr b/tests/ui/privacy/privacy5.stderr index 680161272..615b0af27 100644 --- a/src/test/ui/privacy/privacy5.stderr +++ b/tests/ui/privacy/privacy5.stderr @@ -12,6 +12,10 @@ note: the tuple struct constructor `A` is defined here | LL | pub struct A(()); | ^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct A(pub ()); + | +++ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:52:16 @@ -27,6 +31,10 @@ note: the tuple struct constructor `B` is defined here | LL | pub struct B(isize); | ^^^^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct B(pub isize); + | +++ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:53:16 @@ -42,6 +50,10 @@ note: the tuple struct constructor `C` is defined here | LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the fields publicly accessible + | +LL | pub struct C(pub isize, pub isize); + | ~~~ +++ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:56:12 @@ -57,6 +69,10 @@ note: the tuple struct constructor `A` is defined here | LL | pub struct A(()); | ^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct A(pub ()); + | +++ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:57:12 @@ -72,6 +88,10 @@ note: the tuple struct constructor `A` is defined here | LL | pub struct A(()); | ^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct A(pub ()); + | +++ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:58:18 @@ -87,6 +107,10 @@ note: the tuple struct constructor `A` is defined here | LL | pub struct A(()); | ^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct A(pub ()); + | +++ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:59:18 @@ -102,6 +126,10 @@ note: the tuple struct constructor `A` is defined here | LL | pub struct A(()); | ^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct A(pub ()); + | +++ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:61:12 @@ -117,6 +145,10 @@ note: the tuple struct constructor `B` is defined here | LL | pub struct B(isize); | ^^^^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct B(pub isize); + | +++ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:62:12 @@ -132,6 +164,10 @@ note: the tuple struct constructor `B` is defined here | LL | pub struct B(isize); | ^^^^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct B(pub isize); + | +++ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:63:18 @@ -147,6 +183,10 @@ note: the tuple struct constructor `B` is defined here | LL | pub struct B(isize); | ^^^^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct B(pub isize); + | +++ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:64:18 @@ -162,6 +202,10 @@ note: the tuple struct constructor `B` is defined here | LL | pub struct B(isize); | ^^^^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct B(pub isize); + | +++ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:65:18 @@ -177,6 +221,10 @@ note: the tuple struct constructor `B` is defined here | LL | pub struct B(isize); | ^^^^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct B(pub isize); + | +++ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:65:32 @@ -192,6 +240,10 @@ note: the tuple struct constructor `B` is defined here | LL | pub struct B(isize); | ^^^^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct B(pub isize); + | +++ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:68:12 @@ -207,6 +259,10 @@ note: the tuple struct constructor `C` is defined here | LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the fields publicly accessible + | +LL | pub struct C(pub isize, pub isize); + | ~~~ +++ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:69:12 @@ -222,6 +278,10 @@ note: the tuple struct constructor `C` is defined here | LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the fields publicly accessible + | +LL | pub struct C(pub isize, pub isize); + | ~~~ +++ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:70:12 @@ -237,6 +297,10 @@ note: the tuple struct constructor `C` is defined here | LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the fields publicly accessible + | +LL | pub struct C(pub isize, pub isize); + | ~~~ +++ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:71:12 @@ -252,6 +316,10 @@ note: the tuple struct constructor `C` is defined here | LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the fields publicly accessible + | +LL | pub struct C(pub isize, pub isize); + | ~~~ +++ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:72:18 @@ -267,6 +335,10 @@ note: the tuple struct constructor `C` is defined here | LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the fields publicly accessible + | +LL | pub struct C(pub isize, pub isize); + | ~~~ +++ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:73:18 @@ -282,6 +354,10 @@ note: the tuple struct constructor `C` is defined here | LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the fields publicly accessible + | +LL | pub struct C(pub isize, pub isize); + | ~~~ +++ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:74:18 @@ -297,6 +373,10 @@ note: the tuple struct constructor `C` is defined here | LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the fields publicly accessible + | +LL | pub struct C(pub isize, pub isize); + | ~~~ +++ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:75:18 @@ -312,6 +392,10 @@ note: the tuple struct constructor `C` is defined here | LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the fields publicly accessible + | +LL | pub struct C(pub isize, pub isize); + | ~~~ +++ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:83:17 @@ -327,6 +411,10 @@ note: the tuple struct constructor `A` is defined here | LL | pub struct A(()); | ^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct A(pub ()); + | +++ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:84:17 @@ -342,6 +430,10 @@ note: the tuple struct constructor `B` is defined here | LL | pub struct B(isize); | ^^^^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct B(pub isize); + | +++ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:85:17 @@ -357,6 +449,10 @@ note: the tuple struct constructor `C` is defined here | LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the fields publicly accessible + | +LL | pub struct C(pub isize, pub isize); + | ~~~ +++ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:90:20 diff --git a/src/test/ui/privacy/private-class-field.rs b/tests/ui/privacy/private-class-field.rs index 98e32ee07..98e32ee07 100644 --- a/src/test/ui/privacy/private-class-field.rs +++ b/tests/ui/privacy/private-class-field.rs diff --git a/tests/ui/privacy/private-field-ty-err.rs b/tests/ui/privacy/private-field-ty-err.rs new file mode 100644 index 000000000..10db60695 --- /dev/null +++ b/tests/ui/privacy/private-field-ty-err.rs @@ -0,0 +1,20 @@ +fn main() { + let x = foo::Foo::default(); + if x.len { + //~^ ERROR field `len` of struct `Foo` is private + println!("foo"); + } +} + +mod foo { + #[derive(Default)] + pub struct Foo { + len: String, + } + + impl Foo { + pub fn len(&self) -> usize { + 42 + } + } +} diff --git a/tests/ui/privacy/private-field-ty-err.stderr b/tests/ui/privacy/private-field-ty-err.stderr new file mode 100644 index 000000000..98ba7856e --- /dev/null +++ b/tests/ui/privacy/private-field-ty-err.stderr @@ -0,0 +1,9 @@ +error[E0616]: field `len` of struct `Foo` is private + --> $DIR/private-field-ty-err.rs:3:10 + | +LL | if x.len { + | ^^^ private field + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0616`. diff --git a/src/test/ui/privacy/private-impl-method.rs b/tests/ui/privacy/private-impl-method.rs index f7be6726c..f7be6726c 100644 --- a/src/test/ui/privacy/private-impl-method.rs +++ b/tests/ui/privacy/private-impl-method.rs diff --git a/src/test/ui/privacy/private-impl-method.stderr b/tests/ui/privacy/private-impl-method.stderr index bb54dce7e..bb54dce7e 100644 --- a/src/test/ui/privacy/private-impl-method.stderr +++ b/tests/ui/privacy/private-impl-method.stderr diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.rs b/tests/ui/privacy/private-in-public-assoc-ty.rs index fba72c131..fba72c131 100644 --- a/src/test/ui/privacy/private-in-public-assoc-ty.rs +++ b/tests/ui/privacy/private-in-public-assoc-ty.rs diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.stderr b/tests/ui/privacy/private-in-public-assoc-ty.stderr index a59027d81..a59027d81 100644 --- a/src/test/ui/privacy/private-in-public-assoc-ty.stderr +++ b/tests/ui/privacy/private-in-public-assoc-ty.stderr diff --git a/src/test/ui/privacy/private-in-public-expr-pat.rs b/tests/ui/privacy/private-in-public-expr-pat.rs index 5c9ecd13b..5c9ecd13b 100644 --- a/src/test/ui/privacy/private-in-public-expr-pat.rs +++ b/tests/ui/privacy/private-in-public-expr-pat.rs diff --git a/src/test/ui/privacy/private-in-public-ill-formed.rs b/tests/ui/privacy/private-in-public-ill-formed.rs index 031e2874a..031e2874a 100644 --- a/src/test/ui/privacy/private-in-public-ill-formed.rs +++ b/tests/ui/privacy/private-in-public-ill-formed.rs diff --git a/src/test/ui/privacy/private-in-public-ill-formed.stderr b/tests/ui/privacy/private-in-public-ill-formed.stderr index e7c94bc30..e7c94bc30 100644 --- a/src/test/ui/privacy/private-in-public-ill-formed.stderr +++ b/tests/ui/privacy/private-in-public-ill-formed.stderr diff --git a/src/test/ui/privacy/private-in-public-lint.rs b/tests/ui/privacy/private-in-public-lint.rs index 8b6e43601..8b6e43601 100644 --- a/src/test/ui/privacy/private-in-public-lint.rs +++ b/tests/ui/privacy/private-in-public-lint.rs diff --git a/src/test/ui/privacy/private-in-public-lint.stderr b/tests/ui/privacy/private-in-public-lint.stderr index 1e98e3bed..1e98e3bed 100644 --- a/src/test/ui/privacy/private-in-public-lint.stderr +++ b/tests/ui/privacy/private-in-public-lint.stderr diff --git a/src/test/ui/privacy/private-in-public-non-principal-2.rs b/tests/ui/privacy/private-in-public-non-principal-2.rs index db451d334..db451d334 100644 --- a/src/test/ui/privacy/private-in-public-non-principal-2.rs +++ b/tests/ui/privacy/private-in-public-non-principal-2.rs diff --git a/src/test/ui/privacy/private-in-public-non-principal-2.stderr b/tests/ui/privacy/private-in-public-non-principal-2.stderr index 7cc8bf0de..7cc8bf0de 100644 --- a/src/test/ui/privacy/private-in-public-non-principal-2.stderr +++ b/tests/ui/privacy/private-in-public-non-principal-2.stderr diff --git a/src/test/ui/privacy/private-in-public-non-principal.rs b/tests/ui/privacy/private-in-public-non-principal.rs index ac1d5a9e6..ac1d5a9e6 100644 --- a/src/test/ui/privacy/private-in-public-non-principal.rs +++ b/tests/ui/privacy/private-in-public-non-principal.rs diff --git a/src/test/ui/privacy/private-in-public-non-principal.stderr b/tests/ui/privacy/private-in-public-non-principal.stderr index de20cada4..de20cada4 100644 --- a/src/test/ui/privacy/private-in-public-non-principal.stderr +++ b/tests/ui/privacy/private-in-public-non-principal.stderr diff --git a/src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs b/tests/ui/privacy/private-in-public-type-alias-impl-trait.rs index c7df31529..c7df31529 100644 --- a/src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs +++ b/tests/ui/privacy/private-in-public-type-alias-impl-trait.rs diff --git a/src/test/ui/privacy/private-in-public-warn.rs b/tests/ui/privacy/private-in-public-warn.rs index 0fa1de975..0fa1de975 100644 --- a/src/test/ui/privacy/private-in-public-warn.rs +++ b/tests/ui/privacy/private-in-public-warn.rs diff --git a/src/test/ui/privacy/private-in-public-warn.stderr b/tests/ui/privacy/private-in-public-warn.stderr index 66f91ce6f..66f91ce6f 100644 --- a/src/test/ui/privacy/private-in-public-warn.stderr +++ b/tests/ui/privacy/private-in-public-warn.stderr diff --git a/src/test/ui/privacy/private-in-public.rs b/tests/ui/privacy/private-in-public.rs index dbd1c483f..dbd1c483f 100644 --- a/src/test/ui/privacy/private-in-public.rs +++ b/tests/ui/privacy/private-in-public.rs diff --git a/src/test/ui/privacy/private-in-public.stderr b/tests/ui/privacy/private-in-public.stderr index 887eebf53..887eebf53 100644 --- a/src/test/ui/privacy/private-in-public.stderr +++ b/tests/ui/privacy/private-in-public.stderr diff --git a/src/test/ui/privacy/private-inferred-type-1.rs b/tests/ui/privacy/private-inferred-type-1.rs index d633189e3..d633189e3 100644 --- a/src/test/ui/privacy/private-inferred-type-1.rs +++ b/tests/ui/privacy/private-inferred-type-1.rs diff --git a/src/test/ui/privacy/private-inferred-type-1.stderr b/tests/ui/privacy/private-inferred-type-1.stderr index 245789f43..245789f43 100644 --- a/src/test/ui/privacy/private-inferred-type-1.stderr +++ b/tests/ui/privacy/private-inferred-type-1.stderr diff --git a/src/test/ui/privacy/private-inferred-type-2.rs b/tests/ui/privacy/private-inferred-type-2.rs index 15b263b38..15b263b38 100644 --- a/src/test/ui/privacy/private-inferred-type-2.rs +++ b/tests/ui/privacy/private-inferred-type-2.rs diff --git a/src/test/ui/privacy/private-inferred-type-2.stderr b/tests/ui/privacy/private-inferred-type-2.stderr index 3a0fc03b4..3a0fc03b4 100644 --- a/src/test/ui/privacy/private-inferred-type-2.stderr +++ b/tests/ui/privacy/private-inferred-type-2.stderr diff --git a/src/test/ui/privacy/private-inferred-type-3.rs b/tests/ui/privacy/private-inferred-type-3.rs index 0337aedd0..cdbdcf60b 100644 --- a/src/test/ui/privacy/private-inferred-type-3.rs +++ b/tests/ui/privacy/private-inferred-type-3.rs @@ -1,7 +1,7 @@ // aux-build:private-inferred-type.rs // error-pattern:type `fn() {ext::priv_fn}` is private -// error-pattern:static `PRIV_STATIC` is private +// error-pattern:static `ext::PRIV_STATIC` is private // error-pattern:type `ext::PrivEnum` is private // error-pattern:type `fn() {<u8 as ext::PrivTrait>::method}` is private // error-pattern:type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private diff --git a/src/test/ui/privacy/private-inferred-type-3.stderr b/tests/ui/privacy/private-inferred-type-3.stderr index 00b61512d..42faeb4bf 100644 --- a/src/test/ui/privacy/private-inferred-type-3.stderr +++ b/tests/ui/privacy/private-inferred-type-3.stderr @@ -6,7 +6,7 @@ LL | ext::m!(); | = note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info) -error: static `PRIV_STATIC` is private +error: static `ext::PRIV_STATIC` is private --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); diff --git a/src/test/ui/privacy/private-inferred-type.rs b/tests/ui/privacy/private-inferred-type.rs index e8743dd96..e8743dd96 100644 --- a/src/test/ui/privacy/private-inferred-type.rs +++ b/tests/ui/privacy/private-inferred-type.rs diff --git a/src/test/ui/privacy/private-inferred-type.stderr b/tests/ui/privacy/private-inferred-type.stderr index fc3f9ab62..fc3f9ab62 100644 --- a/src/test/ui/privacy/private-inferred-type.stderr +++ b/tests/ui/privacy/private-inferred-type.stderr diff --git a/src/test/ui/privacy/private-item-simple.rs b/tests/ui/privacy/private-item-simple.rs index 1f718ed92..1f718ed92 100644 --- a/src/test/ui/privacy/private-item-simple.rs +++ b/tests/ui/privacy/private-item-simple.rs diff --git a/src/test/ui/privacy/private-item-simple.stderr b/tests/ui/privacy/private-item-simple.stderr index e3d90150e..e3d90150e 100644 --- a/src/test/ui/privacy/private-item-simple.stderr +++ b/tests/ui/privacy/private-item-simple.stderr diff --git a/src/test/ui/privacy/private-method-cross-crate.rs b/tests/ui/privacy/private-method-cross-crate.rs index ab3bbdfe4..ab3bbdfe4 100644 --- a/src/test/ui/privacy/private-method-cross-crate.rs +++ b/tests/ui/privacy/private-method-cross-crate.rs diff --git a/src/test/ui/privacy/private-method-cross-crate.stderr b/tests/ui/privacy/private-method-cross-crate.stderr index 93f6a7f2f..93f6a7f2f 100644 --- a/src/test/ui/privacy/private-method-cross-crate.stderr +++ b/tests/ui/privacy/private-method-cross-crate.stderr diff --git a/src/test/ui/privacy/private-method-inherited.rs b/tests/ui/privacy/private-method-inherited.rs index 2f6454288..2f6454288 100644 --- a/src/test/ui/privacy/private-method-inherited.rs +++ b/tests/ui/privacy/private-method-inherited.rs diff --git a/src/test/ui/privacy/private-method-inherited.stderr b/tests/ui/privacy/private-method-inherited.stderr index 011a7fee4..011a7fee4 100644 --- a/src/test/ui/privacy/private-method-inherited.stderr +++ b/tests/ui/privacy/private-method-inherited.stderr diff --git a/src/test/ui/privacy/private-method-rpass.rs b/tests/ui/privacy/private-method-rpass.rs index 726944fb2..726944fb2 100644 --- a/src/test/ui/privacy/private-method-rpass.rs +++ b/tests/ui/privacy/private-method-rpass.rs diff --git a/src/test/ui/privacy/private-method.rs b/tests/ui/privacy/private-method.rs index 76a642cde..76a642cde 100644 --- a/src/test/ui/privacy/private-method.rs +++ b/tests/ui/privacy/private-method.rs diff --git a/src/test/ui/privacy/private-method.stderr b/tests/ui/privacy/private-method.stderr index 17c7179dc..17c7179dc 100644 --- a/src/test/ui/privacy/private-method.stderr +++ b/tests/ui/privacy/private-method.stderr diff --git a/src/test/ui/privacy/private-struct-field-cross-crate.rs b/tests/ui/privacy/private-struct-field-cross-crate.rs index 301cd37b7..301cd37b7 100644 --- a/src/test/ui/privacy/private-struct-field-cross-crate.rs +++ b/tests/ui/privacy/private-struct-field-cross-crate.rs diff --git a/src/test/ui/privacy/private-struct-field-cross-crate.stderr b/tests/ui/privacy/private-struct-field-cross-crate.stderr index 40cf3448d..40cf3448d 100644 --- a/src/test/ui/privacy/private-struct-field-cross-crate.stderr +++ b/tests/ui/privacy/private-struct-field-cross-crate.stderr diff --git a/src/test/ui/privacy/private-struct-field-ctor.rs b/tests/ui/privacy/private-struct-field-ctor.rs index 56e84a751..56e84a751 100644 --- a/src/test/ui/privacy/private-struct-field-ctor.rs +++ b/tests/ui/privacy/private-struct-field-ctor.rs diff --git a/src/test/ui/privacy/private-struct-field-ctor.stderr b/tests/ui/privacy/private-struct-field-ctor.stderr index 9dc9db0ea..9dc9db0ea 100644 --- a/src/test/ui/privacy/private-struct-field-ctor.stderr +++ b/tests/ui/privacy/private-struct-field-ctor.stderr diff --git a/src/test/ui/privacy/private-struct-field-pattern.rs b/tests/ui/privacy/private-struct-field-pattern.rs index 4a766500e..4a766500e 100644 --- a/src/test/ui/privacy/private-struct-field-pattern.rs +++ b/tests/ui/privacy/private-struct-field-pattern.rs diff --git a/src/test/ui/privacy/private-struct-field-pattern.stderr b/tests/ui/privacy/private-struct-field-pattern.stderr index 630553036..630553036 100644 --- a/src/test/ui/privacy/private-struct-field-pattern.stderr +++ b/tests/ui/privacy/private-struct-field-pattern.stderr diff --git a/src/test/ui/privacy/private-struct-field.rs b/tests/ui/privacy/private-struct-field.rs index 94cee4eff..94cee4eff 100644 --- a/src/test/ui/privacy/private-struct-field.rs +++ b/tests/ui/privacy/private-struct-field.rs diff --git a/src/test/ui/privacy/private-struct-field.stderr b/tests/ui/privacy/private-struct-field.stderr index facf4e82f..facf4e82f 100644 --- a/src/test/ui/privacy/private-struct-field.stderr +++ b/tests/ui/privacy/private-struct-field.stderr diff --git a/src/test/ui/privacy/private-type-in-interface.rs b/tests/ui/privacy/private-type-in-interface.rs index 7fbdbaf5f..7fbdbaf5f 100644 --- a/src/test/ui/privacy/private-type-in-interface.rs +++ b/tests/ui/privacy/private-type-in-interface.rs diff --git a/src/test/ui/privacy/private-type-in-interface.stderr b/tests/ui/privacy/private-type-in-interface.stderr index 4e87caa34..4e87caa34 100644 --- a/src/test/ui/privacy/private-type-in-interface.stderr +++ b/tests/ui/privacy/private-type-in-interface.stderr diff --git a/src/test/ui/privacy/private-variant-reexport.rs b/tests/ui/privacy/private-variant-reexport.rs index 688284460..688284460 100644 --- a/src/test/ui/privacy/private-variant-reexport.rs +++ b/tests/ui/privacy/private-variant-reexport.rs diff --git a/src/test/ui/privacy/private-variant-reexport.stderr b/tests/ui/privacy/private-variant-reexport.stderr index 78771ee30..78771ee30 100644 --- a/src/test/ui/privacy/private-variant-reexport.stderr +++ b/tests/ui/privacy/private-variant-reexport.stderr diff --git a/src/test/ui/privacy/pub-extern-privacy.rs b/tests/ui/privacy/pub-extern-privacy.rs index dbbbe4e3b..dbbbe4e3b 100644 --- a/src/test/ui/privacy/pub-extern-privacy.rs +++ b/tests/ui/privacy/pub-extern-privacy.rs diff --git a/src/test/ui/privacy/pub-priv-dep/auxiliary/priv_dep.rs b/tests/ui/privacy/pub-priv-dep/auxiliary/priv_dep.rs index e7afeb84f..e7afeb84f 100644 --- a/src/test/ui/privacy/pub-priv-dep/auxiliary/priv_dep.rs +++ b/tests/ui/privacy/pub-priv-dep/auxiliary/priv_dep.rs diff --git a/src/test/ui/privacy/pub-priv-dep/auxiliary/pub_dep.rs b/tests/ui/privacy/pub-priv-dep/auxiliary/pub_dep.rs index 3ebafd953..3ebafd953 100644 --- a/src/test/ui/privacy/pub-priv-dep/auxiliary/pub_dep.rs +++ b/tests/ui/privacy/pub-priv-dep/auxiliary/pub_dep.rs diff --git a/src/test/ui/privacy/pub-priv-dep/pub-priv1.rs b/tests/ui/privacy/pub-priv-dep/pub-priv1.rs index ec8666f93..ec8666f93 100644 --- a/src/test/ui/privacy/pub-priv-dep/pub-priv1.rs +++ b/tests/ui/privacy/pub-priv-dep/pub-priv1.rs diff --git a/src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr b/tests/ui/privacy/pub-priv-dep/pub-priv1.stderr index e62a440d8..e62a440d8 100644 --- a/src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr +++ b/tests/ui/privacy/pub-priv-dep/pub-priv1.stderr diff --git a/src/test/ui/privacy/pub-priv-dep/std-pub.rs b/tests/ui/privacy/pub-priv-dep/std-pub.rs index e25aa93a0..e25aa93a0 100644 --- a/src/test/ui/privacy/pub-priv-dep/std-pub.rs +++ b/tests/ui/privacy/pub-priv-dep/std-pub.rs diff --git a/src/test/ui/privacy/pub-use-xcrate.rs b/tests/ui/privacy/pub-use-xcrate.rs index e8a6e8cf1..e8a6e8cf1 100644 --- a/src/test/ui/privacy/pub-use-xcrate.rs +++ b/tests/ui/privacy/pub-use-xcrate.rs diff --git a/src/test/ui/privacy/pub_use_mods_xcrate_exe.rs b/tests/ui/privacy/pub_use_mods_xcrate_exe.rs index f163619e7..f163619e7 100644 --- a/src/test/ui/privacy/pub_use_mods_xcrate_exe.rs +++ b/tests/ui/privacy/pub_use_mods_xcrate_exe.rs diff --git a/src/test/ui/privacy/reachable-unnameable-items.rs b/tests/ui/privacy/reachable-unnameable-items.rs index 1babe0119..1babe0119 100644 --- a/src/test/ui/privacy/reachable-unnameable-items.rs +++ b/tests/ui/privacy/reachable-unnameable-items.rs diff --git a/src/test/ui/privacy/restricted/auxiliary/pub_restricted.rs b/tests/ui/privacy/restricted/auxiliary/pub_restricted.rs index a4013e6ac..a4013e6ac 100644 --- a/src/test/ui/privacy/restricted/auxiliary/pub_restricted.rs +++ b/tests/ui/privacy/restricted/auxiliary/pub_restricted.rs diff --git a/src/test/ui/privacy/restricted/lookup-ignores-private.rs b/tests/ui/privacy/restricted/lookup-ignores-private.rs index 240ce1e2b..240ce1e2b 100644 --- a/src/test/ui/privacy/restricted/lookup-ignores-private.rs +++ b/tests/ui/privacy/restricted/lookup-ignores-private.rs diff --git a/src/test/ui/privacy/restricted/private-in-public.rs b/tests/ui/privacy/restricted/private-in-public.rs index 1e3dbdf73..1e3dbdf73 100644 --- a/src/test/ui/privacy/restricted/private-in-public.rs +++ b/tests/ui/privacy/restricted/private-in-public.rs diff --git a/src/test/ui/privacy/restricted/private-in-public.stderr b/tests/ui/privacy/restricted/private-in-public.stderr index 65d996f0f..65d996f0f 100644 --- a/src/test/ui/privacy/restricted/private-in-public.stderr +++ b/tests/ui/privacy/restricted/private-in-public.stderr diff --git a/src/test/ui/privacy/restricted/relative-2018.rs b/tests/ui/privacy/restricted/relative-2018.rs index 954169a9f..954169a9f 100644 --- a/src/test/ui/privacy/restricted/relative-2018.rs +++ b/tests/ui/privacy/restricted/relative-2018.rs diff --git a/src/test/ui/privacy/restricted/relative-2018.stderr b/tests/ui/privacy/restricted/relative-2018.stderr index dec0d5157..dec0d5157 100644 --- a/src/test/ui/privacy/restricted/relative-2018.stderr +++ b/tests/ui/privacy/restricted/relative-2018.stderr diff --git a/src/test/ui/privacy/restricted/struct-literal-field.rs b/tests/ui/privacy/restricted/struct-literal-field.rs index 9c6104755..9c6104755 100644 --- a/src/test/ui/privacy/restricted/struct-literal-field.rs +++ b/tests/ui/privacy/restricted/struct-literal-field.rs diff --git a/src/test/ui/privacy/restricted/struct-literal-field.stderr b/tests/ui/privacy/restricted/struct-literal-field.stderr index eee964f02..eee964f02 100644 --- a/src/test/ui/privacy/restricted/struct-literal-field.stderr +++ b/tests/ui/privacy/restricted/struct-literal-field.stderr diff --git a/src/test/ui/privacy/restricted/test.rs b/tests/ui/privacy/restricted/test.rs index a8c269378..a8c269378 100644 --- a/src/test/ui/privacy/restricted/test.rs +++ b/tests/ui/privacy/restricted/test.rs diff --git a/src/test/ui/privacy/restricted/test.stderr b/tests/ui/privacy/restricted/test.stderr index 1acd221b4..1acd221b4 100644 --- a/src/test/ui/privacy/restricted/test.stderr +++ b/tests/ui/privacy/restricted/test.stderr diff --git a/tests/ui/privacy/suggest-making-field-public.fixed b/tests/ui/privacy/suggest-making-field-public.fixed new file mode 100644 index 000000000..78e335b3d --- /dev/null +++ b/tests/ui/privacy/suggest-making-field-public.fixed @@ -0,0 +1,15 @@ +// run-rustfix +mod a { + pub struct A(pub String); +} + +mod b { + use crate::a::A; + pub fn x() { + A("".into()); //~ ERROR cannot initialize a tuple struct which contains private fields + } +} +fn main() { + a::A("a".into()); //~ ERROR tuple struct constructor `A` is private + b::x(); +} diff --git a/tests/ui/privacy/suggest-making-field-public.rs b/tests/ui/privacy/suggest-making-field-public.rs new file mode 100644 index 000000000..b65c801d1 --- /dev/null +++ b/tests/ui/privacy/suggest-making-field-public.rs @@ -0,0 +1,15 @@ +// run-rustfix +mod a { + pub struct A(pub(self)String); +} + +mod b { + use crate::a::A; + pub fn x() { + A("".into()); //~ ERROR cannot initialize a tuple struct which contains private fields + } +} +fn main() { + a::A("a".into()); //~ ERROR tuple struct constructor `A` is private + b::x(); +} diff --git a/tests/ui/privacy/suggest-making-field-public.stderr b/tests/ui/privacy/suggest-making-field-public.stderr new file mode 100644 index 000000000..e92e9aae3 --- /dev/null +++ b/tests/ui/privacy/suggest-making-field-public.stderr @@ -0,0 +1,39 @@ +error[E0603]: tuple struct constructor `A` is private + --> $DIR/suggest-making-field-public.rs:13:8 + | +LL | pub struct A(pub(self)String); + | --------------- a constructor is private if any of the fields is private +... +LL | a::A("a".into()); + | ^ private tuple struct constructor + | +note: the tuple struct constructor `A` is defined here + --> $DIR/suggest-making-field-public.rs:3:5 + | +LL | pub struct A(pub(self)String); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider making the field publicly accessible + | +LL | pub struct A(pub String); + | ~~~ + +error[E0423]: cannot initialize a tuple struct which contains private fields + --> $DIR/suggest-making-field-public.rs:9:9 + | +LL | A("".into()); + | ^ + | +note: constructor is not visible here due to private fields + --> $DIR/suggest-making-field-public.rs:3:18 + | +LL | pub struct A(pub(self)String); + | ^^^^^^^^^^^^^^^ private field +help: consider making the field publicly accessible + | +LL | pub struct A(pub String); + | ~~~ + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0423, E0603. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/privacy/union-field-privacy-1.rs b/tests/ui/privacy/union-field-privacy-1.rs index 8a84bd86a..8a84bd86a 100644 --- a/src/test/ui/privacy/union-field-privacy-1.rs +++ b/tests/ui/privacy/union-field-privacy-1.rs diff --git a/src/test/ui/privacy/union-field-privacy-1.stderr b/tests/ui/privacy/union-field-privacy-1.stderr index b1f0b785e..b1f0b785e 100644 --- a/src/test/ui/privacy/union-field-privacy-1.stderr +++ b/tests/ui/privacy/union-field-privacy-1.stderr diff --git a/src/test/ui/privacy/union-field-privacy-2.rs b/tests/ui/privacy/union-field-privacy-2.rs index f02e0f8a9..f02e0f8a9 100644 --- a/src/test/ui/privacy/union-field-privacy-2.rs +++ b/tests/ui/privacy/union-field-privacy-2.rs diff --git a/src/test/ui/privacy/union-field-privacy-2.stderr b/tests/ui/privacy/union-field-privacy-2.stderr index bf6a2b625..bf6a2b625 100644 --- a/src/test/ui/privacy/union-field-privacy-2.stderr +++ b/tests/ui/privacy/union-field-privacy-2.stderr diff --git a/src/test/ui/privacy/useless-pub.rs b/tests/ui/privacy/useless-pub.rs index fde7cd5d8..fde7cd5d8 100644 --- a/src/test/ui/privacy/useless-pub.rs +++ b/tests/ui/privacy/useless-pub.rs diff --git a/src/test/ui/privacy/useless-pub.stderr b/tests/ui/privacy/useless-pub.stderr index 14c4983ae..14c4983ae 100644 --- a/src/test/ui/privacy/useless-pub.stderr +++ b/tests/ui/privacy/useless-pub.stderr diff --git a/src/test/ui/privacy/where-priv-type.rs b/tests/ui/privacy/where-priv-type.rs index 66ee9c4bb..66ee9c4bb 100644 --- a/src/test/ui/privacy/where-priv-type.rs +++ b/tests/ui/privacy/where-priv-type.rs diff --git a/src/test/ui/privacy/where-priv-type.stderr b/tests/ui/privacy/where-priv-type.stderr index c5fb2cdb0..c5fb2cdb0 100644 --- a/src/test/ui/privacy/where-priv-type.stderr +++ b/tests/ui/privacy/where-priv-type.stderr diff --git a/src/test/ui/privacy/where-pub-type-impls-priv-trait.rs b/tests/ui/privacy/where-pub-type-impls-priv-trait.rs index 87c211df1..87c211df1 100644 --- a/src/test/ui/privacy/where-pub-type-impls-priv-trait.rs +++ b/tests/ui/privacy/where-pub-type-impls-priv-trait.rs diff --git a/src/test/ui/privacy/where-pub-type-impls-priv-trait.stderr b/tests/ui/privacy/where-pub-type-impls-priv-trait.stderr index a433cebbb..a433cebbb 100644 --- a/src/test/ui/privacy/where-pub-type-impls-priv-trait.stderr +++ b/tests/ui/privacy/where-pub-type-impls-priv-trait.stderr |