Skip to content

Commit 3d7e881

Browse files
committedApr 5, 2024·
Auto merge of #123484 - jhpratt:rollup-usz4e64, r=jhpratt
Rollup of 9 pull requests Successful merges: - #123206 (Require Pointee::Metadata to be Freeze) - #123363 (change `NormalizesTo` to fully structurally normalize) - #123407 (Default to light theme if JS is enabled but not working) - #123417 (Add Description for cargo in rustdoc documentation) - #123437 (Manually run `clang-format` on `CoverageMappingWrapper.cpp`) - #123454 (hir: Use `ItemLocalId::ZERO` in a couple more places) - #123464 (Cleanup: Rename `HAS_PROJECTIONS` to `HAS_ALIASES` etc.) - #123477 (do not ICE in `fn forced_ambiguity` if we get an error) - #123478 (CFI: Add test for `call_once` addr taken) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9cbaa01 + e8b0c30 commit 3d7e881

File tree

41 files changed

+286
-374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+286
-374
lines changed
 

‎compiler/rustc_ast_lowering/src/index.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct NodeCollector<'a, 'hir> {
1919
parenting: LocalDefIdMap<ItemLocalId>,
2020

2121
/// The parent of this node
22-
parent_node: hir::ItemLocalId,
22+
parent_node: ItemLocalId,
2323

2424
owner: OwnerId,
2525
}
@@ -31,17 +31,16 @@ pub(super) fn index_hir<'hir>(
3131
bodies: &SortedMap<ItemLocalId, &'hir Body<'hir>>,
3232
num_nodes: usize,
3333
) -> (IndexVec<ItemLocalId, ParentedNode<'hir>>, LocalDefIdMap<ItemLocalId>) {
34-
let zero_id = ItemLocalId::ZERO;
35-
let err_node = ParentedNode { parent: zero_id, node: Node::Err(item.span()) };
34+
let err_node = ParentedNode { parent: ItemLocalId::ZERO, node: Node::Err(item.span()) };
3635
let mut nodes = IndexVec::from_elem_n(err_node, num_nodes);
3736
// This node's parent should never be accessed: the owner's parent is computed by the
3837
// hir_owner_parent query. Make it invalid (= ItemLocalId::MAX) to force an ICE whenever it is
3938
// used.
40-
nodes[zero_id] = ParentedNode { parent: ItemLocalId::INVALID, node: item.into() };
39+
nodes[ItemLocalId::ZERO] = ParentedNode { parent: ItemLocalId::INVALID, node: item.into() };
4140
let mut collector = NodeCollector {
4241
tcx,
4342
owner: item.def_id(),
44-
parent_node: zero_id,
43+
parent_node: ItemLocalId::ZERO,
4544
nodes,
4645
bodies,
4746
parenting: Default::default(),
@@ -112,7 +111,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
112111
}
113112

114113
fn insert_nested(&mut self, item: LocalDefId) {
115-
if self.parent_node.as_u32() != 0 {
114+
if self.parent_node != ItemLocalId::ZERO {
116115
self.parenting.insert(item, self.parent_node);
117116
}
118117
}

‎compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
461461
where
462462
T: TypeVisitable<TyCtxt<'tcx>>,
463463
{
464-
t.has_free_regions() || t.has_projections() || t.has_infer_types()
464+
t.has_free_regions() || t.has_aliases() || t.has_infer_types()
465465
}
466466

467467
pub fn node_ty(&self, id: hir::HirId) -> Ty<'tcx> {

0 commit comments

Comments
 (0)
Please sign in to comment.