diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-11-25 19:51:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-25 19:51:54 +0100 |
| commit | 9a59b059d5461a9de67719a8d8ce8ff8bdd06e06 (patch) | |
| tree | c233eced2dc614fb0c3fd33119022e6d9e401e97 /compiler/rustc_const_eval/src/transform | |
| parent | 6361989b6d22459235b9160c6e94b7a97be8c796 (diff) | |
| parent | 57c9eb73814470d3223e4a0f4ca6ee588648ad6f (diff) | |
| download | rust-9a59b059d5461a9de67719a8d8ce8ff8bdd06e06.tar.gz rust-9a59b059d5461a9de67719a8d8ce8ff8bdd06e06.zip | |
Rollup merge of #117871 - klensy:unused-pub, r=cjgillot
remove unused pub fns This removes some unused `pub fn`; also fixes few obsoleted fn names or added fixmes with reminders to update them.
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/promote_consts.rs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/compiler/rustc_const_eval/src/transform/promote_consts.rs b/compiler/rustc_const_eval/src/transform/promote_consts.rs index 66b813e4e59..8b2ea2dc21d 100644 --- a/compiler/rustc_const_eval/src/transform/promote_consts.rs +++ b/compiler/rustc_const_eval/src/transform/promote_consts.rs @@ -1023,36 +1023,3 @@ pub fn promote_candidates<'tcx>( promotions } - -/// This function returns `true` if the function being called in the array -/// repeat expression is a `const` function. -pub fn is_const_fn_in_array_repeat_expression<'tcx>( - ccx: &ConstCx<'_, 'tcx>, - place: &Place<'tcx>, - body: &Body<'tcx>, -) -> bool { - match place.as_local() { - // rule out cases such as: `let my_var = some_fn(); [my_var; N]` - Some(local) if body.local_decls[local].is_user_variable() => return false, - None => return false, - _ => {} - } - - for block in body.basic_blocks.iter() { - if let Some(Terminator { kind: TerminatorKind::Call { func, destination, .. }, .. }) = - &block.terminator - { - if let Operand::Constant(box ConstOperand { const_, .. }) = func { - if let ty::FnDef(def_id, _) = *const_.ty().kind() { - if destination == place { - if ccx.tcx.is_const_fn(def_id) { - return true; - } - } - } - } - } - } - - false -} |
