diff options
| author | bors <bors@rust-lang.org> | 2024-09-29 15:52:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-09-29 15:52:51 +0000 |
| commit | 42ff2eedb0585e32e3e8da0e83ff82dd49987a2c (patch) | |
| tree | ae744050ea4bcea9c1591adc153aacc7dfe68898 /compiler/rustc_mir_transform/src | |
| parent | d194948e50e90f98c62fb64183bce4d866a665af (diff) | |
| parent | 71c96cc7d5cf4bdb21d75c48e616f8fb195b9ee1 (diff) | |
| download | rust-42ff2eedb0585e32e3e8da0e83ff82dd49987a2c.tar.gz rust-42ff2eedb0585e32e3e8da0e83ff82dd49987a2c.zip | |
Auto merge of #131022 - matthiaskrgr:rollup-g9y1v11, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #130931 (Rename `standalone` doctest attribute into `standalone_crate`) - #131000 (Weekly `cargo update`) - #131011 (cleanup: don't `.into()` identical types) - #131013 (cleanup: don't manually `unwrap_or_default()`) - #131014 (cleanup: don't clone types that are Copy) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/coroutine/by_move_body.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_mir_transform/src/single_use_consts.rs | 5 |
2 files changed, 7 insertions, 8 deletions
diff --git a/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs b/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs index 65442877d2d..cc4b7689d40 100644 --- a/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs +++ b/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs @@ -223,14 +223,14 @@ pub(crate) fn coroutine_by_move_body_def_id<'tcx>( // Inherited from the by-ref coroutine. body_def.codegen_fn_attrs(tcx.codegen_fn_attrs(coroutine_def_id).clone()); - body_def.constness(tcx.constness(coroutine_def_id).clone()); - body_def.coroutine_kind(tcx.coroutine_kind(coroutine_def_id).clone()); + body_def.constness(tcx.constness(coroutine_def_id)); + body_def.coroutine_kind(tcx.coroutine_kind(coroutine_def_id)); body_def.def_ident_span(tcx.def_ident_span(coroutine_def_id)); body_def.def_span(tcx.def_span(coroutine_def_id)); - body_def.explicit_predicates_of(tcx.explicit_predicates_of(coroutine_def_id).clone()); + body_def.explicit_predicates_of(tcx.explicit_predicates_of(coroutine_def_id)); body_def.generics_of(tcx.generics_of(coroutine_def_id).clone()); - body_def.param_env(tcx.param_env(coroutine_def_id).clone()); - body_def.predicates_of(tcx.predicates_of(coroutine_def_id).clone()); + body_def.param_env(tcx.param_env(coroutine_def_id)); + body_def.predicates_of(tcx.predicates_of(coroutine_def_id)); // The type of the coroutine is the `by_move_coroutine_ty`. body_def.type_of(ty::EarlyBinder::bind(by_move_coroutine_ty)); diff --git a/compiler/rustc_mir_transform/src/single_use_consts.rs b/compiler/rustc_mir_transform/src/single_use_consts.rs index 9884b6dd1c3..277a33c0311 100644 --- a/compiler/rustc_mir_transform/src/single_use_consts.rs +++ b/compiler/rustc_mir_transform/src/single_use_consts.rs @@ -185,15 +185,14 @@ impl<'tcx> MutVisitor<'tcx> for LocalReplacer<'tcx> { && let Some(local) = place.as_local() && local == self.local { - let const_op = self + let const_op = *self .operand .as_ref() .unwrap_or_else(|| { bug!("the operand was already stolen"); }) .constant() - .unwrap() - .clone(); + .unwrap(); var_debug_info.value = VarDebugInfoContents::Const(const_op); } } |
