Skip to content

Commit

Permalink
Fix valtree changes
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Jul 2, 2023
1 parent beb0e73 commit 0cbe963
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_utils/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,8 @@ fn field_of_struct<'tcx>(
result: mir::ConstantKind<'tcx>,
field: &Ident,
) -> Option<mir::ConstantKind<'tcx>> {
let dc = lcx.tcx.destructure_mir_constant(lcx.param_env, result);
if let Some(dc_variant) = dc.variant
if let Some(dc) = lcx.tcx.try_destructure_mir_constant(lcx.param_env.and(result))
&& let Some(dc_variant) = dc.variant
&& let Some(variant) = adt_def.variants().get(dc_variant)
&& let Some(field_idx) = variant.fields.iter().position(|el| el.name == field.name)
&& let Some(dc_field) = dc.fields.get(field_idx)
Expand Down

0 comments on commit 0cbe963

Please sign in to comment.