diff options
| author | yuk1ty <yuk1ty@users.noreply.github.com> | 2025-05-03 20:10:56 +0900 |
|---|---|---|
| committer | yuk1ty <yuk1ty@users.noreply.github.com> | 2025-05-03 20:10:56 +0900 |
| commit | 265b10fe2e411a7af34f892aaa7635fba96cce2c (patch) | |
| tree | 5297331a7e81ca86b88a6e17d12c838f3ba3afca /compiler/rustc_middle/src/ty/mod.rs | |
| parent | d2eadb7a94ef8c9deb5137695df33cd1fc5aee92 (diff) | |
| download | rust-265b10fe2e411a7af34f892aaa7635fba96cce2c.tar.gz rust-265b10fe2e411a7af34f892aaa7635fba96cce2c.zip | |
Correct warning message in restricted visibility
Diffstat (limited to 'compiler/rustc_middle/src/ty/mod.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index eba6d61ba7d..112010b3508 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -297,7 +297,10 @@ impl Visibility { } else if restricted_id == tcx.parent_module_from_def_id(def_id).to_local_def_id() { "pub(self)".to_string() } else { - format!("pub({})", tcx.item_name(restricted_id.to_def_id())) + format!( + "pub(in crate{})", + tcx.def_path(restricted_id.to_def_id()).to_string_no_crate_verbose() + ) } } ty::Visibility::Public => "pub".to_string(), |
