rustup https://github.com/rust-lang/rust/pull/71116#5467
rustup https://github.com/rust-lang/rust/pull/71116#5467bors merged 2 commits intorust-lang:masterfrom
Conversation
clippy_lints/src/utils/author.rs
Outdated
| use rustc_hir::def_id::{LocalDefId, CRATE_DEF_INDEX}; | ||
| use rustc_hir::{HirId, DUMMY_ITEM_LOCAL_ID}; | ||
|
|
||
| const DUMMY_HIR_ID: HirId = HirId { | ||
| owner: LocalDefId { | ||
| local_def_index: CRATE_DEF_INDEX, | ||
| }, | ||
| local_id: DUMMY_ITEM_LOCAL_ID, | ||
| }; |
There was a problem hiding this comment.
There must be a way to avoid reintroducing this.
clippy_lints/src/utils/author.rs
Outdated
| } | ||
| prelude(); | ||
| PrintVisitor::new("var").visit_variant(var, &hir::Generics::empty(), hir::DUMMY_HIR_ID); | ||
| PrintVisitor::new("var").visit_variant(var, &hir::Generics::empty(), DUMMY_HIR_ID); |
There was a problem hiding this comment.
Something like cx.tcx.hir().get_parent(var.hir_id) should give you a valid HirId.
There was a problem hiding this comment.
Which probably means we can remove the HirId arguments from visit_variant and visit_variant_data and visit_enum_def, maybe. Depends on which visitors use them and for what.
There was a problem hiding this comment.
Thanks!
I'm not familiar with how the author lint works, I switched to cx.tcx.hir().get_parent_node(var.id); now.
|
LGTM @bors r+ |
|
📌 Commit 7215495 has been approved by |
rustup rust-lang/rust#71116 changelog: none
|
@bors p=2 treeclosed=1 |
clippy_lints/src/utils/author.rs
Outdated
| } | ||
| prelude(); | ||
| PrintVisitor::new("var").visit_variant(var, &hir::Generics::empty(), hir::DUMMY_HIR_ID); | ||
| let dummy_hir_id = cx.tcx.hir().get_parent_node(var.id); |
There was a problem hiding this comment.
This is not dummy. This is the correct HirId for the HIR visitor method.
There was a problem hiding this comment.
Eh.. :(
I'll change it in a follow up pr that we can add to the rollup
There was a problem hiding this comment.
GHA got stuck anyway in the caching process.
|
💔 Test failed - checks-action_test |
|
@bors r+ |
|
📌 Commit a353f0f has been approved by |
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
changelog: none