summaryrefslogtreecommitdiff
path: root/compiler/rustc_metadata
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_metadata')
-rw-r--r--compiler/rustc_metadata/src/rmeta/encoder.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs
index 26226386ef7..d8cfceab460 100644
--- a/compiler/rustc_metadata/src/rmeta/encoder.rs
+++ b/compiler/rustc_metadata/src/rmeta/encoder.rs
@@ -1339,8 +1339,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
is_doc_hidden: false,
};
let attr_iter = tcx
- .opt_local_def_id_to_hir_id(def_id)
- .map_or(Default::default(), |hir_id| tcx.hir().attrs(hir_id))
+ .hir()
+ .attrs(tcx.local_def_id_to_hir_id(def_id))
.iter()
.filter(|attr| analyze_attr(attr, &mut state));