-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Deconstruct values in the HIR visitor #141931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
compiler/rustc_hir/src/intravisit.rs
compiler/rustc_hir/src/intravisit.rs
@@ -1018,8 +1040,9 @@ pub fn walk_const_arg<'v, V: Visitor<'v>>( | |||
match const_arg.try_as_ambig_ct() { | |||
Some(ambig_ct) => visitor.visit_const_arg(ambig_ct), | |||
None => { | |||
try_visit!(visitor.visit_id(const_arg.hir_id)); | |||
visitor.visit_infer(const_arg.hir_id, const_arg.span(), InferKind::Const(const_arg)) | |||
let ConstArg { hir_id, kind: _ } = const_arg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind
being skipped here might be a bug. No need to do anything about it in this PR, we can fix it elsewhere, but great that this PR has identified this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need reverse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave it unchanged. If it needs fixing we can do in a follow-up.
@@ -1288,16 +1332,20 @@ pub fn walk_precise_capturing_arg<'v, V: Visitor<'v>>( | |||
) -> V::Result { | |||
match *arg { | |||
PreciseCapturingArg::Lifetime(lt) => visitor.visit_lifetime(lt), | |||
PreciseCapturingArg::Param(param) => visitor.visit_id(param.hir_id), | |||
PreciseCapturingArg::Param(param) => { | |||
let PreciseCapturingNonLifetimeArg { hir_id, ident: _, res: _ } = param; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skipping the ident
here is also suspicious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need reverse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed #141999 to fix this.
Can you change the commit message to say "Deconstruct values in the THIR visitor"? Then this will be ready to merge. Thanks. |
Thanks for the review! Tell me, taking into account your comments, should I still remove the destructor in match expressions? |
0027cf6
to
624e1cd
Compare
@bors r+ rollup |
Rollup of 8 pull requests Successful merges: - #141724 (fix(#141141): When expanding `PartialEq`, check equality of scalar types first.) - #141833 (`tests/ui`: A New Order [2/N]) - #141861 (Switch `x86_64-msvc-{1,2}` back to Windows Server 2025 images) - #141914 (redesign stage 0 std follow-ups) - #141918 (Deconstruct values in the THIR visitor) - #141923 (Update books) - #141931 (Deconstruct values in the THIR visitor) - #141956 (Remove two trait methods from cg_ssa) r? `@ghost` `@rustbot` modify labels: rollup
Whoops, the commit message should have said "HIR visitor" instead of "THIR visitor". Oh well, too late now :) |
Thanks again for your help with the first rust commit! |
I continue to add deconstruction for task #141849
The changes concern a more complex part of the task
compiler/rustc_hir/src/intravisit.rs
r? @nnethercote