Conversation
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
Yep, that's the one; I thought I could adjust it to compare vs. 1 on the right hand side, but then it fails with |
|
|
||
| fn insert_item(&mut self, id: NodeId, item: hir::Item) { | ||
| fn insert_item(&mut self, item: hir::Item) { | ||
| let id = item.hir_id; |
There was a problem hiding this comment.
Maybe you could try asserting that the local id of the item is 0 here?
You could also try printing out information about the item which isn't 0.
There was a problem hiding this comment.
Got one:
non-zero local id in Item {
ident: TryFrom#0,
hir_id: HirId { owner: DefIndex(0:147), local_id: 1 },
attrs: [],
node: Use(path(convert::TryFrom), Single),
vis: Spanned { node: Inherited, span: Span { lo: BytePos(73297), hi: BytePos(73297), ctxt: #0 } },
span: Span { lo: BytePos(73311), hi: BytePos(73318), ctxt: #0 }
}
|
This is likely an error in |
|
Are you sure all the items should have a |
|
|
||
| node_ids.into_iter() | ||
| .map(|node_id| hir::ItemId { id: self.lower_node_id(node_id).hir_id }) | ||
| .collect() |
There was a problem hiding this comment.
I replaced this with:
node_ids.into_iter().map(|node_id| hir::ItemId {
id: self.lower_node_id_generic(node_id, |_| {
panic!("expected node_id to be lowered already {:#?}", i)
}).hir_id
}).collect()
That panics and shows the the following item wasn't assigned a HirId:
expected node_id to be lowered already Item {
ident: #0,
attrs: [],
id: NodeId(2249),
node: Use(
UseTree {
prefix: path(convert),
kind: Nested(
[
(
UseTree {
prefix: path(TryFrom),
kind: Simple(
None,
NodeId(2252),
NodeId(2253)
),
},
NodeId(2254)
),
(
UseTree {
prefix: path(Infallible),
kind: Simple(
None,
NodeId(2256),
NodeId(2257)
),
},
NodeId(2258)
)
]
),
}
),
vis: Spanned {
node: Inherited,
},
}
I guess this means that either too many NodeIds are in this list or some id is not being correctly lowered to a HirId.
@oli-obk Do you have any ideas?
There was a problem hiding this comment.
These node ids haven't been lowered yet at all. lower_item_id is called before the item is lowered in order to obtain any sub-item's ids. If you want to error if a second lowering fails, you'll need to do that where the actual items are lowered (so after lower_item_id is called).
There was a problem hiding this comment.
I see that only AST items had their ids lowered in MiscCollector. I changed that to also include the use trees in #59413.
HirIdify hir::ItemId Version of rust-lang#59092. r? @oli-obk
|
☔ The latest upstream changes (presumably #59478) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@Zoxc is this done now? should this be closed? |
|
Yep, this was a part of the merged PR. |
Pushing the limits of HirIdification (#57578).
Replaces
NodeIdwithHirIdinhir::ItemId. It currently fails during adebug_assertin https://github.com/rust-lang/rust/blob/master/src/librustc/ich/impls_hir.rs#L793.r? @Zoxc