diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2022-05-21 14:45:14 -0400 |
|---|---|---|
| committer | Jacob Pratt <jacob@jhpratt.dev> | 2022-05-21 17:02:55 -0400 |
| commit | 7b987e34c083c81a9e70cb1d387759ac98c752c0 (patch) | |
| tree | 10c8a23db1578e3d6978fe0ee2ea7321515c0794 /compiler/rustc_ast_pretty/src/pprust | |
| parent | 8cece636b22620717d6e242ec20fa8d5cf979072 (diff) | |
| download | rust-7b987e34c083c81a9e70cb1d387759ac98c752c0.tar.gz rust-7b987e34c083c81a9e70cb1d387759ac98c752c0.zip | |
Merge crate and restricted visibilities
Diffstat (limited to 'compiler/rustc_ast_pretty/src/pprust')
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state/item.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/item.rs b/compiler/rustc_ast_pretty/src/pprust/state/item.rs index 7151a9f6938..67b539a7ad4 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state/item.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state/item.rs @@ -403,10 +403,9 @@ impl<'a> State<'a> { pub(crate) fn print_visibility(&mut self, vis: &ast::Visibility) { match vis.kind { ast::VisibilityKind::Public => self.word_nbsp("pub"), - ast::VisibilityKind::Crate => self.word_nbsp("pub(crate)"), ast::VisibilityKind::Restricted { ref path, .. } => { let path = Self::to_string(|s| s.print_path(path, false, 0)); - if path == "self" || path == "super" { + if path == "crate" || path == "self" || path == "super" { self.word_nbsp(format!("pub({})", path)) } else { self.word_nbsp(format!("pub(in {})", path)) |
