Skip to content

Commit 3e8c8d8

Browse files
committed
hir: Add some FIXMEs for future work
1 parent a61019b commit 3e8c8d8

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

compiler/rustc_ast_lowering/src/index.rs

+1
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
265265
}
266266

267267
fn visit_path_segment(&mut self, path_segment: &'hir PathSegment<'hir>) {
268+
// FIXME: walk path segment with `path_segment.hir_id` parent.
268269
self.insert(path_segment.ident.span, path_segment.hir_id, Node::PathSegment(path_segment));
269270
intravisit::walk_path_segment(self, path_segment);
270271
}

compiler/rustc_hir/src/hir.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3493,6 +3493,7 @@ pub enum Node<'hir> {
34933493
Crate(&'hir Mod<'hir>),
34943494
Infer(&'hir InferArg),
34953495
WhereBoundPredicate(&'hir WhereBoundPredicate<'hir>),
3496+
// FIXME: Merge into `Node::Infer`.
34963497
ArrayLenInfer(&'hir InferArg),
34973498
// Span by reference to minimize `Node`'s size
34983499
#[allow(rustc::pass_by_value)]

compiler/rustc_hir/src/intravisit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ pub fn walk_pat_field<'v, V: Visitor<'v>>(visitor: &mut V, field: &'v PatField<'
669669

670670
pub fn walk_array_len<'v, V: Visitor<'v>>(visitor: &mut V, len: &'v ArrayLen) {
671671
match len {
672+
// FIXME: Use `visit_infer` here.
672673
ArrayLen::Infer(InferArg { hir_id, span: _ }) => visitor.visit_id(*hir_id),
673674
ArrayLen::Body(c) => visitor.visit_anon_const(c),
674675
}

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

+3
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ impl<'hir> Map<'hir> {
222222
/// If calling repeatedly and iterating over parents, prefer [`Map::parent_iter`].
223223
pub fn opt_parent_id(self, id: HirId) -> Option<HirId> {
224224
if id.local_id == ItemLocalId::from_u32(0) {
225+
// FIXME: This function never returns `None` right now, and the parent chain end is
226+
// determined by checking for `parent(id) == id`. This function should return `None`
227+
// for the crate root instead.
225228
Some(self.tcx.hir_owner_parent(id.owner))
226229
} else {
227230
let owner = self.tcx.hir_owner_nodes(id.owner);

0 commit comments

Comments
 (0)