Skip to content

Commit be80c82

Browse files
committed
hir: Add some FIXMEs for future work
1 parent e292423 commit be80c82

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

compiler/rustc_ast_lowering/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
753753
fn lower_import_res(&mut self, id: NodeId) -> SmallVec<[Res; 3]> {
754754
let res = self.resolver.get_import_res(id).present_items();
755755
let res: SmallVec<_> = res.map(|res| self.lower_res(res)).collect();
756+
// FIXME: The `Res::Err` doesn't necessarily mean an error was reported, it also happens
757+
// for import list stem items with non-empty list. Instead, consider not emitting such
758+
// items into HIR at all, or fill the `import_res_map` tables for them in resolve if that
759+
// is not possible. Then add `span_delayed_bug` here.
756760
if !res.is_empty() { res } else { smallvec![Res::Err] }
757761
}
758762

compiler/rustc_hir/src/hir.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3499,6 +3499,7 @@ pub enum Node<'hir> {
34993499
Crate(&'hir Mod<'hir>),
35003500
Infer(&'hir InferArg),
35013501
WhereBoundPredicate(&'hir WhereBoundPredicate<'hir>),
3502+
// FIXME: Merge into `Node::Infer`.
35023503
ArrayLenInfer(&'hir InferArg),
35033504
// Span by reference to minimize `Node`'s size
35043505
#[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)