mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Rollup merge of #96982 - klensy:no-expect, r=Dylan-DPC
fix clippy expect_fun_call
This commit is contained in:
commit
384caefbb6
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user