Skip to content

Commit

Permalink
Rollup merge of #96982 - klensy:no-expect, r=Dylan-DPC
Browse files Browse the repository at this point in the history
fix clippy expect_fun_call
  • Loading branch information
matthiaskrgr authored May 13, 2022
2 parents 281be09 + 7f31825 commit 384caef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_const_eval/src/const_eval/valtrees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ fn slice_branches<'tcx>(
ecx: &CompileTimeEvalContext<'tcx, 'tcx>,
place: &MPlaceTy<'tcx>,
) -> Option<ty::ValTree<'tcx>> {
let n = place.len(&ecx.tcx.tcx).expect(&format!("expected to use len of place {:?}", place));
let n = place
.len(&ecx.tcx.tcx)
.unwrap_or_else(|_| panic!("expected to use len of place {:?}", place));
let branches = (0..n).map(|i| {
let place_elem = ecx.mplace_index(place, i).unwrap();
const_to_valtree_inner(ecx, &place_elem)
Expand Down

0 comments on commit 384caef

Please sign in to comment.