Stream: t-compiler/help

Topic: Setting lint levels on struct expr fields

Andy Russell (Feb 12 2020 at 03:42, on Zulip):

Hi All, I'm trying to tackle I've tracked down the issue to a combination of the fact that struct expr attributes aren't stored in the lint level map, and the stability of a struct field attribute is checked by looking at the HIR ID of the whole expression, not the field.

It's easy enough to fix the lint level map issue. I added a visit_field method to intravisit::Visitor and then used that in the lint_levels query. However, changing the stability check is harder: I run into a bug!() because the HIR ID of the field has no parent.

I'm wondering what to do next. I could try to give the field a parent in the HIR map, but this is a significant change because it would involve adding a new HIR node. Is there a better solution?

Last update: Sep 22 2020 at 00:00UTC