Skip to content

Commit b93ed5f

Browse files
committed
fix
1 parent b072a4a commit b93ed5f

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

compiler/rustc_middle/src/hir/map/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
242242
fn insert_nested(&mut self, item: HirOwner) {
243243
#[cfg(debug_assertions)]
244244
{
245-
let dk_parent = self.definitions.def_key(item).parent.unwrap();
245+
let dk_parent = self.definitions.def_key(item.def_id).parent.unwrap();
246246
let dk_parent = LocalDefId { local_def_index: dk_parent };
247247
let dk_parent = self.definitions.local_def_id_to_hir_id(dk_parent);
248248
debug_assert_eq!(

compiler/rustc_middle/src/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_ast::Attribute;
1313
use rustc_data_structures::fingerprint::Fingerprint;
1414
use rustc_data_structures::fx::FxHashMap;
1515
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
16-
use rustc_hir::def_id::{LocalDefId};
16+
use rustc_hir::def_id::LocalDefId;
1717
use rustc_hir::hir_id::HirOwner;
1818
use rustc_hir::*;
1919
use rustc_index::vec::IndexVec;

compiler/rustc_passes/src/diagnostic_items.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ fn collect_item(
9595
/// Extract the first `rustc_diagnostic_item = "$name"` out of a list of attributes.
9696
fn extract(sess: &Session, attrs: &[ast::Attribute]) -> Option<Symbol> {
9797
attrs.iter().find_map(|attr| {
98-
if sess.check_name(attr, sym::rustc_diagnostic_item) {
99-
attr.value_str()
100-
} else {
101-
None
102-
}
98+
if sess.check_name(attr, sym::rustc_diagnostic_item) { attr.value_str() } else { None }
10399
})
104100
}
105101

0 commit comments

Comments
 (0)