Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/item_tree/pretty.rs')
-rw-r--r--crates/hir-def/src/item_tree/pretty.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/hir-def/src/item_tree/pretty.rs b/crates/hir-def/src/item_tree/pretty.rs
index 66a2d14a73..94a6cce3ce 100644
--- a/crates/hir-def/src/item_tree/pretty.rs
+++ b/crates/hir-def/src/item_tree/pretty.rs
@@ -7,8 +7,8 @@ use span::{Edition, ErasedFileAstId};
use crate::{
item_tree::{
Const, DefDatabase, Enum, ExternBlock, ExternCrate, FieldsShape, Function, Impl, ItemTree,
- Macro2, MacroCall, MacroRules, Mod, ModItemId, ModKind, RawVisibilityId, Static, Struct,
- Trait, TypeAlias, Union, Use, UseTree, UseTreeKind, attrs::AttrsOrCfg,
+ Macro2, MacroCall, MacroRules, Mod, ModItemId, ModKind, RawAttrs, RawVisibilityId, Static,
+ Struct, Trait, TypeAlias, Union, Use, UseTree, UseTreeKind,
},
visibility::RawVisibility,
};
@@ -85,13 +85,9 @@ impl Printer<'_> {
}
}
- fn print_attrs(&mut self, attrs: &AttrsOrCfg, inner: bool, separated_by: &str) {
- let AttrsOrCfg::Enabled { attrs } = attrs else {
- w!(self, "#[cfg(false)]{separated_by}");
- return;
- };
+ fn print_attrs(&mut self, attrs: &RawAttrs, inner: bool, separated_by: &str) {
let inner = if inner { "!" } else { "" };
- for attr in &*attrs.as_ref() {
+ for attr in &**attrs {
w!(
self,
"#{}[{}{}]{}",