Skip to content

Add a visibility suggestion in private-in-public errors #113983

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 5 commits into from

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Jul 23, 2023

This modifies the original #112540 by @aryan-debug to fix #112284

This PR introduces a new field vis_sugg to suggest the proper visibility for the error.

TODO: What should the TODO values be here? Note that not a single test anywhere has used these ???TODO??? values, so it is unclear how they can be generated. Maybe this whole match should be simplified to map Restricted(_) => "pub(crate)" ?

let vis_sugg = match self.required_visibility {
    ty::Visibility::Public => "pub",
    ty::Visibility::Restricted(vis_def_id) => {
        if vis_def_id == self.tcx.parent_module(hir_id) {
            "???TODO???"
        } else if vis_def_id.is_top_level_module() {
            "pub(crate)"
        } else {
            "???TODO???"
        }
    }
};

@rustbot
Copy link
Collaborator

rustbot commented Jul 23, 2023

r? @WaffleLapkin

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 23, 2023
@nyurik nyurik changed the title Pub in priv err Add a visibility suggestion in private-in-public errors Jul 23, 2023
@rust-log-analyzer

This comment has been minimized.

@nyurik nyurik force-pushed the pub-in-priv-err branch from ad5d3b9 to e9c1d6d Compare July 23, 2023 17:19
@WaffleLapkin
Copy link
Member

r? compiler-errors

@petrochenkov
Copy link
Contributor

I don't think this change is still relevant after #113126.

@nyurik
Copy link
Contributor Author

nyurik commented Jul 24, 2023

@petrochenkov thx for the heads up! I looked through that PR (even left a comment), but I'm not certain I understand if it will cover all cases?

I see this change adds self.in_assoc_ty bool, so clearly the error will still exist if its an associated type? Is this planned to change as well? Should the suggestion I did in this PR be addapted to #113126?

if self.in_assoc_ty && !vis.is_at_least(self.required_visibility, self.tcx) {

@compiler-errors
Copy link
Member

r? petrochenkov

@petrochenkov
Copy link
Contributor

Blocked on #113126.
@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 26, 2023
@bors

This comment was marked as resolved.

@petrochenkov
Copy link
Contributor

#113126 has landed.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Sep 1, 2023
@Dylan-DPC
Copy link
Member

@nyurik any updates?

@nyurik
Copy link
Contributor Author

nyurik commented Nov 2, 2023

@Dylan-DPC thx for the ping, i have updated the PR, but it still has some outstanding questions that need some feedback. Thx!

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 3, 2023
@nyurik
Copy link
Contributor Author

nyurik commented Nov 13, 2023

@petrochenkov hi, would you be the right person to review this? I would love to move forward, but it is a bit unclear. Plus @JohnCSimon was pinging the original author of this PR (before my refactoring). Hopefully the outstanding questions can be easily addressed. Thx!!

@petrochenkov
Copy link
Contributor

@petrochenkov hi, would you be the right person to review this?

Yes, but maybe a bit later, I'm busy this week.

@@ -1475,12 +1475,31 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
}
};

// FIXME: this code was adapted from the above `vis_descr` computation,
// but it's not clear if it's correct.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think fn vis_to_string should be usable here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure it will work. I tried to

  • add rustc_ast_pretty = { path = "../rustc_ast_pretty" } to Cargo.toml
  • use it with let vis_sugg = rustc_ast_pretty::pprust::vis_to_string(&self.required_visibility);

But the ty::Visibility that I have here -- enum { Default, Hidden, Protected } is not the same as the one vis_to_string expects -- a struct ast::Visibility with kind/span/tokens. Is there a way i can get the struct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant ty::Visibility::to_string, not vis_to_string from rustc_ast_pretty, sorry.

ty::Visibility::to_string was also called vis_to_string when this comment was written, but it was renamed in #115993.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 24, 2023
@bors

This comment was marked as resolved.

@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label Jan 12, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git rebase -i master
$ # delete any merge commits in the editor that appears
$ git push --force-with-lease

The following commits are merge commits:

@dtolnay dtolnay removed the has-merge-commits PR has merge commits, merge with caution. label Jan 21, 2024
@Dylan-DPC
Copy link
Member

@nyurik any updates on replying to the changes requested in the review and implement them accordingly?

Copy link
Contributor Author

@nyurik nyurik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the ping! I am still interested in this PR, but got a bit stuck on implementing it

@@ -1475,12 +1475,31 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
}
};

// FIXME: this code was adapted from the above `vis_descr` computation,
// but it's not clear if it's correct.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure it will work. I tried to

  • add rustc_ast_pretty = { path = "../rustc_ast_pretty" } to Cargo.toml
  • use it with let vis_sugg = rustc_ast_pretty::pprust::vis_to_string(&self.required_visibility);

But the ty::Visibility that I have here -- enum { Default, Hidden, Protected } is not the same as the one vis_to_string expects -- a struct ast::Visibility with kind/span/tokens. Is there a way i can get the struct?

@bors

This comment was marked as resolved.

@nyurik nyurik force-pushed the pub-in-priv-err branch from 95db42f to 8ca5759 Compare May 2, 2024 18:57
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#16 exporting to docker image format
#16 sending tarball 29.3s done
#16 DONE 36.0s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-17]
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-17/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---
failures:

---- [ui] tests/ui/const-generics/generic_const_exprs/eval-privacy.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/const-generics/generic_const_exprs/eval-privacy.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/generic_const_exprs/eval-privacy" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/generic_const_exprs/eval-privacy/auxiliary"
--- stderr -------------------------------
thread 'rustc' panicked at compiler/rustc_errors/src/translation.rs:50:84:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
the attribute `help` was missing
help: add `.help = <message>`
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   2: core::result::unwrap_failed
   3: <&mut <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0} as core::ops::function::FnOnce<(&(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style),)>>::call_once
   4: <alloc::string::String as core::iter::traits::collect::FromIterator<alloc::borrow::Cow<str>>>::from_iter::<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style)>, <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0}>>
   5: <&mut <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1} as core::ops::function::FnOnce<(&rustc_errors::diagnostic::Subdiag,)>>::call_once
   6: <core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>> as core::iter::traits::iterator::Iterator>::next
   7: <alloc::vec::Vec<rustc_errors::json::Diagnostic> as alloc::vec::spec_from_iter::SpecFromIter<rustc_errors::json::Diagnostic, core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>>>>::from_iter
   8: <rustc_errors::json::Diagnostic>::from_errors_diagnostic
   9: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
  10: <rustc_errors::DiagCtxtInner>::emit_diagnostic::{closure#3}
  11: rustc_interface::callbacks::track_diagnostic::<core::option::Option<rustc_span::ErrorGuaranteed>>
  12: <rustc_errors::DiagCtxtInner>::emit_diagnostic
  13: <rustc_errors::DiagCtxt>::emit_diagnostic
  14: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
  15: <rustc_privacy::SearchInterfaceForPrivateItemsVisitor as rustc_privacy::DefIdVisitor>::visit_def_id
  16: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  17: <rustc_middle::ty::consts::Const as rustc_type_ir::visit::TypeSuperVisitable<rustc_middle::ty::context::TyCtxt>>::super_visit_with::<rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor>>
  18: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_const
  19: <rustc_middle::ty::consts::kind::Expr as rustc_type_ir::visit::TypeVisitable<rustc_middle::ty::context::TyCtxt>>::visit_with::<rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor>>
  20: <rustc_middle::ty::consts::Const as rustc_type_ir::visit::TypeSuperVisitable<rustc_middle::ty::context::TyCtxt>>::super_visit_with::<rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor>>
  21: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_const
  22: <rustc_middle::ty::Ty as rustc_type_ir::visit::TypeSuperVisitable<rustc_middle::ty::context::TyCtxt>>::super_visit_with::<rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor>>
  23: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  24: <rustc_privacy::PrivateItemsInPublicInterfacesChecker>::check_assoc_item
  25: rustc_privacy::check_private_in_public
      [... omitted 2 frames ...]
  26: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#1}::{closure#0}::{closure#6}>>
  27: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  28: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>>
  29: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>
  31: rustc_interface::passes::analysis
  31: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  33: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  34: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  35: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (dc2a50fb9 2024-05-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [check_private_in_public] checking for private elements in public interfaces
end of query stack
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0446`.
For more information about this error, try `rustc --explain E0446`.
------------------------------------------


---- [ui] tests/ui/error-codes/E0446.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/error-codes/E0446.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0446" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0446/auxiliary"
--- stderr -------------------------------
thread 'rustc' panicked at compiler/rustc_errors/src/translation.rs:50:84:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
the attribute `help` was missing
help: add `.help = <message>`
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   2: core::result::unwrap_failed
   3: <&mut <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0} as core::ops::function::FnOnce<(&(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style),)>>::call_once
   4: <alloc::string::String as core::iter::traits::collect::FromIterator<alloc::borrow::Cow<str>>>::from_iter::<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style)>, <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0}>>
   5: <&mut <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1} as core::ops::function::FnOnce<(&rustc_errors::diagnostic::Subdiag,)>>::call_once
   6: <core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>> as core::iter::traits::iterator::Iterator>::next
   7: <alloc::vec::Vec<rustc_errors::json::Diagnostic> as alloc::vec::spec_from_iter::SpecFromIter<rustc_errors::json::Diagnostic, core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>>>>::from_iter
   8: <rustc_errors::json::Diagnostic>::from_errors_diagnostic
   9: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
  10: <rustc_errors::DiagCtxtInner>::emit_diagnostic::{closure#3}
  11: rustc_interface::callbacks::track_diagnostic::<core::option::Option<rustc_span::ErrorGuaranteed>>
  12: <rustc_errors::DiagCtxtInner>::emit_diagnostic
  13: <rustc_errors::DiagCtxt>::emit_diagnostic
  14: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
  15: <rustc_privacy::SearchInterfaceForPrivateItemsVisitor as rustc_privacy::DefIdVisitor>::visit_def_id
  16: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  17: <rustc_privacy::PrivateItemsInPublicInterfacesChecker>::check_assoc_item
  18: rustc_privacy::check_private_in_public
      [... omitted 2 frames ...]
  19: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#1}::{closure#0}::{closure#6}>>
  20: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  21: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>>
  22: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>
  24: rustc_interface::passes::analysis
  24: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  26: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  27: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  28: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (dc2a50fb9 2024-05-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [check_private_in_public] checking for private elements in public interfaces
end of query stack
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0446`.
For more information about this error, try `rustc --explain E0446`.
------------------------------------------


---- [ui] tests/ui/privacy/issue-30079.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/privacy/issue-30079.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/issue-30079" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/issue-30079/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
warning: type `m1::Priv` is more private than the item `m1::<impl SemiPriv>::f`
   |
   |
LL |         pub fn f(_: Priv) {} //~ WARN type `m1::Priv` is more private than the item `m1::<impl SemiPriv>::f`
   |         ^^^^^^^^^^^^^^^^^ associated function `m1::<impl SemiPriv>::f` is reachable at visibility `pub(crate)`
   |
note: but type `m1::Priv` is only usable at visibility `pub(self)`
   |
LL |     struct Priv;
   |     ^^^^^^^^^^^
   = note: `#[warn(private_interfaces)]` on by default
   = note: `#[warn(private_interfaces)]` on by default

thread 'rustc' panicked at compiler/rustc_errors/src/translation.rs:50:84:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
the attribute `help` was missing
help: add `.help = <message>`
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   2: core::result::unwrap_failed
   3: <&mut <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0} as core::ops::function::FnOnce<(&(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style),)>>::call_once
   4: <alloc::string::String as core::iter::traits::collect::FromIterator<alloc::borrow::Cow<str>>>::from_iter::<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style)>, <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0}>>
   5: <&mut <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1} as core::ops::function::FnOnce<(&rustc_errors::diagnostic::Subdiag,)>>::call_once
   6: <core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>> as core::iter::traits::iterator::Iterator>::next
   7: <alloc::vec::Vec<rustc_errors::json::Diagnostic> as alloc::vec::spec_from_iter::SpecFromIter<rustc_errors::json::Diagnostic, core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>>>>::from_iter
   8: <rustc_errors::json::Diagnostic>::from_errors_diagnostic
   9: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
  10: <rustc_errors::DiagCtxtInner>::emit_diagnostic::{closure#3}
  11: rustc_interface::callbacks::track_diagnostic::<core::option::Option<rustc_span::ErrorGuaranteed>>
  12: <rustc_errors::DiagCtxtInner>::emit_diagnostic
  13: <rustc_errors::DiagCtxt>::emit_diagnostic
  14: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
  15: <rustc_privacy::SearchInterfaceForPrivateItemsVisitor as rustc_privacy::DefIdVisitor>::visit_def_id
  16: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  17: <rustc_privacy::PrivateItemsInPublicInterfacesChecker>::check_assoc_item
  18: rustc_privacy::check_private_in_public
      [... omitted 2 frames ...]
  19: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#1}::{closure#0}::{closure#6}>>
  20: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  21: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>>
  22: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>
  24: rustc_interface::passes::analysis
  24: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  26: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  27: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  28: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (dc2a50fb9 2024-05-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [check_private_in_public] checking for private elements in public interfaces
end of query stack
error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0446`.
For more information about this error, try `rustc --explain E0446`.
------------------------------------------


---- [ui] tests/ui/privacy/private-in-public-assoc-ty.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/privacy/private-in-public-assoc-ty.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/private-in-public-assoc-ty" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/private-in-public-assoc-ty/auxiliary"
--- stderr -------------------------------
thread 'rustc' panicked at compiler/rustc_errors/src/translation.rs:50:84:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
the attribute `help` was missing
help: add `.help = <message>`
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   2: core::result::unwrap_failed
   3: <&mut <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0} as core::ops::function::FnOnce<(&(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style),)>>::call_once
   4: <alloc::string::String as core::iter::traits::collect::FromIterator<alloc::borrow::Cow<str>>>::from_iter::<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style)>, <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0}>>
   5: <&mut <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1} as core::ops::function::FnOnce<(&rustc_errors::diagnostic::Subdiag,)>>::call_once
   6: <core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>> as core::iter::traits::iterator::Iterator>::next
   7: <alloc::vec::Vec<rustc_errors::json::Diagnostic> as alloc::vec::spec_from_iter::SpecFromIter<rustc_errors::json::Diagnostic, core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>>>>::from_iter
   8: <rustc_errors::json::Diagnostic>::from_errors_diagnostic
   9: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
  10: <rustc_errors::DiagCtxtInner>::emit_diagnostic::{closure#3}
  11: rustc_interface::callbacks::track_diagnostic::<core::option::Option<rustc_span::ErrorGuaranteed>>
  12: <rustc_errors::DiagCtxtInner>::emit_diagnostic
  13: <rustc_errors::DiagCtxt>::emit_diagnostic
  14: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
  15: <rustc_privacy::SearchInterfaceForPrivateItemsVisitor as rustc_privacy::DefIdVisitor>::visit_def_id
  16: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  17: <rustc_privacy::PrivateItemsInPublicInterfacesChecker>::check_assoc_item
  18: rustc_privacy::check_private_in_public
      [... omitted 2 frames ...]
  19: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#1}::{closure#0}::{closure#6}>>
  20: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  21: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>>
  22: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>
  24: rustc_interface::passes::analysis
  24: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  26: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  27: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  28: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (dc2a50fb9 2024-05-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [check_private_in_public] checking for private elements in public interfaces
end of query stack
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0446`.
For more information about this error, try `rustc --explain E0446`.
------------------------------------------


---- [ui] tests/ui/privacy/private-in-public-warn.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/privacy/private-in-public-warn.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/private-in-public-warn" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/private-in-public-warn/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: type `types::Priv` is more private than the item `types::Alias`
   |
   |
LL |     pub type Alias = Priv; //~ ERROR type `types::Priv` is more private than the item `types::Alias`
   |     ^^^^^^^^^^^^^^ type alias `types::Alias` is reachable at visibility `pub(crate)`
   |
note: but type `types::Priv` is only usable at visibility `pub(self)`
   |
LL |     struct Priv;
   |     ^^^^^^^^^^^
note: the lint level is defined here
note: the lint level is defined here
  --> /checkout/tests/ui/privacy/private-in-public-warn.rs:5:9
   |
LL | #![deny(private_interfaces, private_bounds)]
   |         ^^^^^^^^^^^^^^^^^^

error: type `types::Priv` is more private than the item `E::V1::0`
   |
   |
LL |         V1(Priv), //~ ERROR type `types::Priv` is more private than the item `E::V1::0`
   |            ^^^^ field `E::V1::0` is reachable at visibility `pub(crate)`
   |
note: but type `types::Priv` is only usable at visibility `pub(self)`
   |
LL |     struct Priv;
   |     ^^^^^^^^^^^


error: type `types::Priv` is more private than the item `E::V2::field`
   |
   |
LL |         V2 { field: Priv }, //~ ERROR type `types::Priv` is more private than the item `E::V2::field`
   |              ^^^^^^^^^^^ field `E::V2::field` is reachable at visibility `pub(crate)`
   |
note: but type `types::Priv` is only usable at visibility `pub(self)`
   |
LL |     struct Priv;
   |     ^^^^^^^^^^^


error: type `types::Priv` is more private than the item `Tr::C`
   |
   |
LL |         const C: Priv = Priv; //~ ERROR type `types::Priv` is more private than the item `Tr::C`
   |         ^^^^^^^^^^^^^ associated constant `Tr::C` is reachable at visibility `pub(crate)`
   |
note: but type `types::Priv` is only usable at visibility `pub(self)`
   |
LL |     struct Priv;
   |     ^^^^^^^^^^^


thread 'rustc' panicked at compiler/rustc_errors/src/translation.rs:50:84:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
the attribute `help` was missing
help: add `.help = <message>`
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   2: core::result::unwrap_failed
   3: <&mut <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0} as core::ops::function::FnOnce<(&(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style),)>>::call_once
   4: <alloc::string::String as core::iter::traits::collect::FromIterator<alloc::borrow::Cow<str>>>::from_iter::<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style)>, <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0}>>
   5: <&mut <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1} as core::ops::function::FnOnce<(&rustc_errors::diagnostic::Subdiag,)>>::call_once
   6: <core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>> as core::iter::traits::iterator::Iterator>::next
   7: <alloc::vec::Vec<rustc_errors::json::Diagnostic> as alloc::vec::spec_from_iter::SpecFromIter<rustc_errors::json::Diagnostic, core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>>>>::from_iter
   8: <rustc_errors::json::Diagnostic>::from_errors_diagnostic
   9: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
  10: <rustc_errors::DiagCtxtInner>::emit_diagnostic::{closure#3}
  11: rustc_interface::callbacks::track_diagnostic::<core::option::Option<rustc_span::ErrorGuaranteed>>
  12: <rustc_errors::DiagCtxtInner>::emit_diagnostic
  13: <rustc_errors::DiagCtxt>::emit_diagnostic
  14: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
  15: <rustc_privacy::SearchInterfaceForPrivateItemsVisitor as rustc_privacy::DefIdVisitor>::visit_def_id
  16: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  17: <rustc_privacy::PrivateItemsInPublicInterfacesChecker>::check_assoc_item
  18: rustc_privacy::check_private_in_public
      [... omitted 2 frames ...]
  19: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#1}::{closure#0}::{closure#6}>>
  20: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  21: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>>
  22: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>
  24: rustc_interface::passes::analysis
  24: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  26: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  27: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  28: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (dc2a50fb9 2024-05-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [check_private_in_public] checking for private elements in public interfaces
end of query stack
warning: bounds on generic parameters are not enforced in type aliases
##[warning]  --> /checkout/tests/ui/privacy/private-in-public-warn.rs:41:23
   |
   |
LL |     pub type Alias<T: PrivTr> = T; //~ ERROR trait `traits::PrivTr` is more private than the item `traits::Alias`
   |
   = note: `#[warn(type_alias_bounds)]` on by default
help: the bound will not be checked when the type alias is used, and should be removed
   |
   |
LL -     pub type Alias<T: PrivTr> = T; //~ ERROR trait `traits::PrivTr` is more private than the item `traits::Alias`
LL +     pub type Alias<T> = T; //~ ERROR trait `traits::PrivTr` is more private than the item `traits::Alias`

warning: where clauses are not enforced in type aliases
##[warning]  --> /checkout/tests/ui/privacy/private-in-public-warn.rs:59:29
   |
   |
LL |     pub type Alias<T> where T: PrivTr = T;
   |
help: the clause will not be checked when the type alias is used, and should be removed
   |
   |
LL -     pub type Alias<T> where T: PrivTr = T;
LL +     pub type Alias<T>  = T;

error: aborting due to 5 previous errors; 2 warnings emitted

For more information about this error, try `rustc --explain E0446`.
For more information about this error, try `rustc --explain E0446`.
------------------------------------------


---- [ui] tests/ui/privacy/private-inferred-type.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/privacy/private-inferred-type.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/private-inferred-type" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/private-inferred-type/auxiliary"
--- stderr -------------------------------
thread 'rustc' panicked at compiler/rustc_errors/src/translation.rs:50:84:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
the attribute `help` was missing
help: add `.help = <message>`
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   2: core::result::unwrap_failed
   3: <&mut <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0} as core::ops::function::FnOnce<(&(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style),)>>::call_once
   4: <alloc::string::String as core::iter::traits::collect::FromIterator<alloc::borrow::Cow<str>>>::from_iter::<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style)>, <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0}>>
   5: <&mut <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1} as core::ops::function::FnOnce<(&rustc_errors::diagnostic::Subdiag,)>>::call_once
   6: <core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>> as core::iter::traits::iterator::Iterator>::next
   7: <alloc::vec::Vec<rustc_errors::json::Diagnostic> as alloc::vec::spec_from_iter::SpecFromIter<rustc_errors::json::Diagnostic, core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>>>>::from_iter
   8: <rustc_errors::json::Diagnostic>::from_errors_diagnostic
   9: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
  10: <rustc_errors::DiagCtxtInner>::emit_diagnostic::{closure#3}
  11: rustc_interface::callbacks::track_diagnostic::<core::option::Option<rustc_span::ErrorGuaranteed>>
  12: <rustc_errors::DiagCtxtInner>::emit_diagnostic
  13: <rustc_errors::DiagCtxt>::emit_diagnostic
  14: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
  15: <rustc_privacy::SearchInterfaceForPrivateItemsVisitor as rustc_privacy::DefIdVisitor>::visit_def_id
  16: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  17: <rustc_privacy::PrivateItemsInPublicInterfacesChecker>::check_assoc_item
  18: rustc_privacy::check_private_in_public
      [... omitted 2 frames ...]
  19: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#1}::{closure#0}::{closure#6}>>
  20: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  21: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>>
  22: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>
  24: rustc_interface::passes::analysis
  24: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  26: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  27: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  28: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (dc2a50fb9 2024-05-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [check_private_in_public] checking for private elements in public interfaces
end of query stack
error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:97:9
   |
   |
LL |     let _: m::Alias; //~ ERROR type `Priv` is private
   |         ^ private type
error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:97:12
   |
   |
LL |     let _: m::Alias; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:99:13
   |
   |
LL |     let _: <m::Alias as m::TraitWithAssocTy>::AssocTy; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:100:5
   |
   |
LL |     m::Alias {}; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:101:5
   |
   |
LL |     m::Pub { 0: m::Alias {} }; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:103:5
   |
   |
LL |     m::Pub::static_method; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:104:5
   |
   |
LL |     m::Pub::INHERENT_ASSOC_CONST; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:105:5
   |
   |
LL |     m::Pub(0u8).method_with_substs::<m::Alias>(); //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:106:17
   |
   |
LL |     m::Pub(0u8).method_with_priv_params(loop{}); //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:107:5
   |
   |
LL |     <m::Alias as m::TraitWithAssocConst>::TRAIT_ASSOC_CONST; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:108:6
   |
   |
LL |     <m::Pub<m::Alias>>::INHERENT_ASSOC_CONST; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:109:5
   |
   |
LL |     <m::Pub<m::Alias>>::INHERENT_ASSOC_CONST_GENERIC_SELF; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:110:5
   |
   |
LL |     <m::Pub<m::Alias>>::static_method_generic_self; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:112:5
   |
   |
LL |     u8::pub_method; //~ ERROR type `Priv` is private

error: type `S2` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:114:5
   |
   |
LL |     adjust::S1.method_s3(); //~ ERROR type `S2` is private


error: type `fn() {priv_fn}` is private
   |
   |
LL |         priv_fn; //~ ERROR type `fn() {priv_fn}` is private
...
...
LL |     m::m!();
   |
   |
   = note: this error originates in the macro `m::m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: type `PrivEnum` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:41:9
   |
   |
LL |         PrivEnum::Variant; //~ ERROR type `PrivEnum` is private
...
...
LL |     m::m!();
   |
   |
   = note: this error originates in the macro `m::m` (in Nightly builds, run with -Z macro-backtrace for more info)

error: type `fn() {<u8 as PrivTrait>::method}` is private
   |
   |
LL |         <u8 as PrivTrait>::method; //~ ERROR type `fn() {<u8 as PrivTrait>::method}` is private
...
...
LL |     m::m!();
   |
   |
   = note: this error originates in the macro `m::m` (in Nightly builds, run with -Z macro-backtrace for more info)

error: type `fn(u8) -> PrivTupleStruct {PrivTupleStruct}` is private
   |
LL |         PrivTupleStruct;
   |         ^^^^^^^^^^^^^^^ private type
...
...
LL |     m::m!();
   |
   |
   = note: this error originates in the macro `m::m` (in Nightly builds, run with -Z macro-backtrace for more info)

error: type `fn(u8) -> PubTupleStruct {PubTupleStruct}` is private
   |
LL |         PubTupleStruct;
   |         ^^^^^^^^^^^^^^ private type
...
...
LL |     m::m!();
   |
   |
   = note: this error originates in the macro `m::m` (in Nightly builds, run with -Z macro-backtrace for more info)

error: type `for<'a> fn(&'a Pub<u8>) {Pub::<u8>::priv_method}` is private
   |
   |
LL |         Pub(0u8).priv_method();
...
...
LL |     m::m!();
   |
   |
   = note: this error originates in the macro `m::m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: trait `Trait` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:118:5
   |
   |
LL |     m::leak_anon1(); //~ ERROR trait `Trait` is private
   |     ^^^^^^^^^^^^^^^ private trait
error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:119:5
   |
   |
LL |     m::leak_anon2(); //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:120:5
   |
   |
LL |     m::leak_anon3(); //~ ERROR type `Priv` is private

error: trait `Trait` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:122:5
   |
   |
LL |     m::leak_dyn1(); //~ ERROR trait `Trait` is private
   |     ^^^^^^^^^^^^^^ private trait
error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:123:5
   |
   |
LL |     m::leak_dyn2(); //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:124:5
   |
   |
LL |     m::leak_dyn3(); //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:127:13
   |
   |
LL |     let a = m::Alias {}; //~ ERROR type `Priv` is private

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:128:17
   |
   |
LL |     let mut b = a; //~ ERROR type `Priv` is private
   |                 ^ private type
error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:129:9
   |
   |
LL |     b = a; //~ ERROR type `Priv` is private
   |         ^ private type
error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/private-inferred-type.rs:130:11
   |
   |
LL |     match a { //~ ERROR type `Priv` is private
   |           ^ private type
error: aborting due to 32 previous errors

For more information about this error, try `rustc --explain E0446`.
------------------------------------------
------------------------------------------


---- [ui] tests/ui/privacy/projections.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/privacy/projections.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/projections" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/projections/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
warning: type `Priv` is more private than the item `Leak`
   |
   |
LL |     pub type Leak = Priv; //~ WARN: `Priv` is more private than the item `Leak`
   |     ^^^^^^^^^^^^^ type alias `Leak` is reachable at visibility `pub(crate)`
   |
note: but type `Priv` is only usable at visibility `pub(self)`
   |
LL |     struct Priv;
   |     ^^^^^^^^^^^
   = note: `#[warn(private_interfaces)]` on by default
   = note: `#[warn(private_interfaces)]` on by default

thread 'rustc' panicked at compiler/rustc_errors/src/translation.rs:50:84:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
the attribute `help` was missing
help: add `.help = <message>`
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   2: core::result::unwrap_failed
   3: <&mut <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0} as core::ops::function::FnOnce<(&(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style),)>>::call_once
   4: <alloc::string::String as core::iter::traits::collect::FromIterator<alloc::borrow::Cow<str>>>::from_iter::<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style)>, <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0}>>
   5: <&mut <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1} as core::ops::function::FnOnce<(&rustc_errors::diagnostic::Subdiag,)>>::call_once
   6: <core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>> as core::iter::traits::iterator::Iterator>::next
   7: <alloc::vec::Vec<rustc_errors::json::Diagnostic> as alloc::vec::spec_from_iter::SpecFromIter<rustc_errors::json::Diagnostic, core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>>>>::from_iter
   8: <rustc_errors::json::Diagnostic>::from_errors_diagnostic
   9: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
  10: <rustc_errors::DiagCtxtInner>::emit_diagnostic::{closure#3}
  11: rustc_interface::callbacks::track_diagnostic::<core::option::Option<rustc_span::ErrorGuaranteed>>
  12: <rustc_errors::DiagCtxtInner>::emit_diagnostic
  13: <rustc_errors::DiagCtxt>::emit_diagnostic
  14: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
  15: <rustc_privacy::SearchInterfaceForPrivateItemsVisitor as rustc_privacy::DefIdVisitor>::visit_def_id
  16: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  17: <rustc_privacy::PrivateItemsInPublicInterfacesChecker>::check_assoc_item
  18: rustc_privacy::check_private_in_public
      [... omitted 2 frames ...]
  19: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#1}::{closure#0}::{closure#6}>>
  20: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  21: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>>
  22: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>
  24: rustc_interface::passes::analysis
  24: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  26: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  27: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  28: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (dc2a50fb9 2024-05-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [check_private_in_public] checking for private elements in public interfaces
end of query stack
error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/projections.rs:14:15
   |
   |
LL | fn check() -> <u8 as Trait>::A<m::Leak> {

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/projections.rs:29:39
   |
   |
LL |   fn check2() -> <u8 as Trait2>::A<u32> {
   |  _______________________________________^
LL | |     //~^ ERROR: `Priv` is private
LL | |     todo!()
   | |_^ private type

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/projections.rs:24:17
##[error]  --> /checkout/tests/ui/privacy/projections.rs:24:17
   |
LL |     type A<T> = m::Leak;

error: type `Priv` is private
##[error]  --> /checkout/tests/ui/privacy/projections.rs:39:24
   |
   |
LL |     type A<T: Trait> = T::A<m::Leak>;

error: aborting due to 5 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0446`.
For more information about this error, try `rustc --explain E0446`.
------------------------------------------


---- [ui] tests/ui/privacy/projections2.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/privacy/projections2.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/projections2" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/projections2/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
warning: type `Priv` is more private than the item `Leak`
   |
   |
LL |     pub type Leak = Priv; //~ WARN: `Priv` is more private than the item `Leak`
   |     ^^^^^^^^^^^^^ type alias `Leak` is reachable at visibility `pub(crate)`
   |
note: but type `Priv` is only usable at visibility `pub(self)`
   |
LL |     struct Priv;
   |     ^^^^^^^^^^^
   = note: `#[warn(private_interfaces)]` on by default
   = note: `#[warn(private_interfaces)]` on by default

thread 'rustc' panicked at compiler/rustc_errors/src/translation.rs:50:84:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
the attribute `help` was missing
help: add `.help = <message>`
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   2: core::result::unwrap_failed
   3: <&mut <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0} as core::ops::function::FnOnce<(&(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style),)>>::call_once
   4: <alloc::string::String as core::iter::traits::collect::FromIterator<alloc::borrow::Cow<str>>>::from_iter::<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style)>, <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0}>>
   5: <&mut <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1} as core::ops::function::FnOnce<(&rustc_errors::diagnostic::Subdiag,)>>::call_once
   6: <core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>> as core::iter::traits::iterator::Iterator>::next
   7: <alloc::vec::Vec<rustc_errors::json::Diagnostic> as alloc::vec::spec_from_iter::SpecFromIter<rustc_errors::json::Diagnostic, core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>>>>::from_iter
   8: <rustc_errors::json::Diagnostic>::from_errors_diagnostic
   9: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
  10: <rustc_errors::DiagCtxtInner>::emit_diagnostic::{closure#3}
  11: rustc_interface::callbacks::track_diagnostic::<core::option::Option<rustc_span::ErrorGuaranteed>>
  12: <rustc_errors::DiagCtxtInner>::emit_diagnostic
  13: <rustc_errors::DiagCtxt>::emit_diagnostic
  14: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
  15: <rustc_privacy::SearchInterfaceForPrivateItemsVisitor as rustc_privacy::DefIdVisitor>::visit_def_id
  16: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  17: <rustc_privacy::PrivateItemsInPublicInterfacesChecker>::check_assoc_item
  18: rustc_privacy::check_private_in_public
      [... omitted 2 frames ...]
  19: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#1}::{closure#0}::{closure#6}>>
  20: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  21: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>>
  22: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>
  24: rustc_interface::passes::analysis
  24: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  26: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  27: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  28: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (dc2a50fb9 2024-05-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [check_private_in_public] checking for private elements in public interfaces
end of query stack
error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0446`.
For more information about this error, try `rustc --explain E0446`.
------------------------------------------


---- [ui] tests/ui/privacy/where-priv-type.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/privacy/where-priv-type.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/where-priv-type" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/privacy/where-priv-type/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
warning: type `PrivTy` is more private than the item `S`
   |
LL | pub struct S
LL | pub struct S
   | ^^^^^^^^^^^^ struct `S` is reachable at visibility `pub`
   |
note: but type `PrivTy` is only usable at visibility `pub(crate)`
   |
LL | struct PrivTy;
   | ^^^^^^^^^^^^^
   = note: `#[warn(private_bounds)]` on by default
   = note: `#[warn(private_bounds)]` on by default

warning: type `PrivTy` is more private than the item `E`
   |
LL | pub enum E
LL | pub enum E
   | ^^^^^^^^^^ enum `E` is reachable at visibility `pub`
   |
note: but type `PrivTy` is only usable at visibility `pub(crate)`
   |
LL | struct PrivTy;
   | ^^^^^^^^^^^^^


warning: type `PrivTy` is more private than the item `f`
   |
LL | / pub fn f()
LL | / pub fn f()
LL | | //~^ WARNING type `PrivTy` is more private than the item `f`
LL | |     PrivTy:
LL | |     PrivTy:
   | |___________^ function `f` is reachable at visibility `pub`
   |
note: but type `PrivTy` is only usable at visibility `pub(crate)`
   |
LL | struct PrivTy;
   | ^^^^^^^^^^^^^


warning: type `PrivTy` is more private than the item `S`
   |
LL | / impl S
LL | / impl S
LL | | //~^ WARNING type `PrivTy` is more private than the item `S`
LL | |     PrivTy:
LL | |     PrivTy:
   | |___________^ implementation `S` is reachable at visibility `pub`
   |
note: but type `PrivTy` is only usable at visibility `pub(crate)`
   |
LL | struct PrivTy;
   | ^^^^^^^^^^^^^


warning: type `PrivTy` is more private than the item `S::f`
   |
LL | /     pub fn f()
LL | /     pub fn f()
LL | |     //~^ WARNING type `PrivTy` is more private than the item `S::f`
LL | |         PrivTy:
LL | |         PrivTy:
   | |_______________^ associated function `S::f` is reachable at visibility `pub`
   |
note: but type `PrivTy` is only usable at visibility `pub(crate)`
   |
LL | struct PrivTy;
   | ^^^^^^^^^^^^^


thread 'rustc' panicked at compiler/rustc_errors/src/translation.rs:50:84:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `privacy_in_public_interface`: 
the attribute `help` was missing
help: add `.help = <message>`
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   2: core::result::unwrap_failed
   3: <&mut <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0} as core::ops::function::FnOnce<(&(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style),)>>::call_once
   4: <alloc::string::String as core::iter::traits::collect::FromIterator<alloc::borrow::Cow<str>>>::from_iter::<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_error_messages::DiagMessage, rustc_errors::snippet::Style)>, <rustc_errors::json::JsonEmitter as rustc_errors::translation::Translate>::translate_messages::{closure#0}>>
   5: <&mut <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1} as core::ops::function::FnOnce<(&rustc_errors::diagnostic::Subdiag,)>>::call_once
   6: <core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>> as core::iter::traits::iterator::Iterator>::next
   7: <alloc::vec::Vec<rustc_errors::json::Diagnostic> as alloc::vec::spec_from_iter::SpecFromIter<rustc_errors::json::Diagnostic, core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_errors::diagnostic::Subdiag>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#1}>, core::iter::adapters::map::Map<core::iter::adapters::flatten::Flatten<core::result::Iter<alloc::vec::Vec<rustc_errors::CodeSuggestion>>>, <rustc_errors::json::Diagnostic>::from_errors_diagnostic::{closure#0}>>>>::from_iter
   8: <rustc_errors::json::Diagnostic>::from_errors_diagnostic
   9: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
  10: <rustc_errors::DiagCtxtInner>::emit_diagnostic::{closure#3}
  11: rustc_interface::callbacks::track_diagnostic::<core::option::Option<rustc_span::ErrorGuaranteed>>
  12: <rustc_errors::DiagCtxtInner>::emit_diagnostic
  13: <rustc_errors::DiagCtxt>::emit_diagnostic
  14: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
  15: <rustc_privacy::SearchInterfaceForPrivateItemsVisitor as rustc_privacy::DefIdVisitor>::visit_def_id
  16: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  17: <rustc_middle::ty::consts::Const as rustc_type_ir::visit::TypeSuperVisitable<rustc_middle::ty::context::TyCtxt>>::super_visit_with::<rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor>>
  18: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_const
  19: <rustc_middle::ty::consts::kind::Expr as rustc_type_ir::visit::TypeVisitable<rustc_middle::ty::context::TyCtxt>>::visit_with::<rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor>>
  20: <rustc_middle::ty::consts::Const as rustc_type_ir::visit::TypeSuperVisitable<rustc_middle::ty::context::TyCtxt>>::super_visit_with::<rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor>>
  21: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_const
  22: <rustc_middle::ty::Ty as rustc_type_ir::visit::TypeSuperVisitable<rustc_middle::ty::context::TyCtxt>>::super_visit_with::<rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor>>
  23: <rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::SearchInterfaceForPrivateItemsVisitor> as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  24: <rustc_privacy::PrivateItemsInPublicInterfacesChecker>::check_assoc_item
  25: rustc_privacy::check_private_in_public
      [... omitted 2 frames ...]
  26: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#1}::{closure#0}::{closure#6}>>
  27: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  28: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>>
  29: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}>
  31: rustc_interface::passes::analysis
  31: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  33: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
  34: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  35: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (dc2a50fb9 2024-05-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [check_private_in_public] checking for private elements in public interfaces
end of query stack
error: aborting due to 1 previous error; 5 warnings emitted

For more information about this error, try `rustc --explain E0446`.

@Dylan-DPC Dylan-DPC added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 30, 2024
@petrochenkov
Copy link
Contributor

#113983 (comment) wasn't addressed, the suggestion spans are incorrect and CI is failing.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 30, 2024
@JohnCSimon
Copy link
Member

@nyurik

Ping from triage: I'm closing this due to inactivity, Please reopen when you are ready to continue with this.
Note: if you are going to continue please open the PR BEFORE you push to it, else you won't be able to reopen - this is a quirk of github.
Thanks for your contribution.

@rustbot label: +S-inactive

@JohnCSimon JohnCSimon closed this Sep 4, 2024
@rustbot rustbot added the S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. label Sep 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggest code correction for E0446 - private type in public interface