Skip to content

Commit c64a440

Browse files
committed
fix few more
warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_trait_selection\src\traits\project.rs:511:12 | 511 | selcx: &mut SelectionContext<'a, 'tcx>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&SelectionContext<'a, 'tcx>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_trait_selection\src\traits\specialize\specialization_graph.rs:201:28 | 201 | fn iter_children(children: &mut Children) -> impl Iterator<Item = DefId> + '_ { | ^^^^^^^^^^^^^ help: consider changing to: `&Children` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
1 parent afd0a8e commit c64a440

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ pub(super) fn opt_normalize_projection_type<'a, 'b, 'tcx>(
508508
/// because it contains `[type error]`. Yuck! (See issue #29857 for
509509
/// one case where this arose.)
510510
fn normalize_to_error<'a, 'tcx>(
511-
selcx: &mut SelectionContext<'a, 'tcx>,
511+
selcx: &SelectionContext<'a, 'tcx>,
512512
param_env: ty::ParamEnv<'tcx>,
513513
projection_ty: ty::AliasTy<'tcx>,
514514
cause: ObligationCause<'tcx>,

compiler/rustc_trait_selection/src/traits/specialize/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ fn fulfill_implication<'tcx>(
239239

240240
let source_trait = ImplSubject::Trait(source_trait_ref);
241241

242-
let selcx = &mut SelectionContext::new(infcx);
242+
let selcx = SelectionContext::new(infcx);
243243
let target_args = infcx.fresh_args_for_item(DUMMY_SP, target_impl);
244244
let (target_trait, obligations) =
245-
util::impl_subject_and_oblig(selcx, param_env, target_impl, target_args, error_cause);
245+
util::impl_subject_and_oblig(&selcx, param_env, target_impl, target_args, error_cause);
246246

247247
// do the impls unify? If not, no specialization.
248248
let Ok(InferOk { obligations: more_obligations, .. }) = infcx

compiler/rustc_trait_selection/src/traits/specialize/specialization_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl<'tcx> Children {
198198
}
199199
}
200200

201-
fn iter_children(children: &mut Children) -> impl Iterator<Item = DefId> + '_ {
201+
fn iter_children(children: &Children) -> impl Iterator<Item = DefId> + '_ {
202202
let nonblanket = children.non_blanket_impls.iter().flat_map(|(_, v)| v.iter());
203203
children.blanket_impls.iter().chain(nonblanket).cloned()
204204
}

compiler/rustc_trait_selection/src/traits/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl Iterator for SupertraitDefIds<'_> {
205205
/// returning the resulting subject and all obligations that arise.
206206
/// The obligations are closed under normalization.
207207
pub fn impl_subject_and_oblig<'a, 'tcx>(
208-
selcx: &mut SelectionContext<'a, 'tcx>,
208+
selcx: &SelectionContext<'a, 'tcx>,
209209
param_env: ty::ParamEnv<'tcx>,
210210
impl_def_id: DefId,
211211
impl_args: GenericArgsRef<'tcx>,

0 commit comments

Comments
 (0)