diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-24 08:49:49 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-24 11:12:34 +1000 |
| commit | 055a27da2afcc8a7d74a551c32e8a831a825d549 (patch) | |
| tree | 0e167ff7afcba57293c846f18ea79f112db4ed66 /compiler/rustc_trait_selection/src/traits | |
| parent | b8c54d6358926028ac2fab1ec2b8665c70edb1c0 (diff) | |
| download | rust-055a27da2afcc8a7d74a551c32e8a831a825d549.tar.gz rust-055a27da2afcc8a7d74a551c32e8a831a825d549.zip | |
Remove some unnecessary clones.
I found these by grepping for `&[a-z_\.]*\.clone()`, i.e. expressions like `&a.b.clone()`, which are sometimes unnecessary clones, and also looking at clones nearby to cases like that.
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs index 4eecde00eaa..f059bd00768 100644 --- a/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs +++ b/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs @@ -117,8 +117,7 @@ fn relate_mir_and_user_args<'tcx>( CRATE_DEF_ID, ObligationCauseCode::AscribeUserTypeProvePredicate(predicate_span), ); - let instantiated_predicate = - ocx.normalize(&cause.clone(), param_env, instantiated_predicate); + let instantiated_predicate = ocx.normalize(&cause, param_env, instantiated_predicate); ocx.register_obligation(Obligation::new(tcx, cause, param_env, instantiated_predicate)); } |
