diff options
| author | bors <bors@rust-lang.org> | 2023-02-18 00:20:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-18 00:20:52 +0000 |
| commit | a9842c73bcd78ca4c2ec56f3e529aed79bd37df7 (patch) | |
| tree | d643279e187292a87bc8e7d78edb212c714e8fa0 /compiler/rustc_trait_selection/src/solve | |
| parent | 231bcd131d109d41e5705f48b9c5a6e70c98ff80 (diff) | |
| parent | af32411f20d4e4f79a2c8b4b645b2693a46c3d7d (diff) | |
| download | rust-a9842c73bcd78ca4c2ec56f3e529aed79bd37df7.tar.gz rust-a9842c73bcd78ca4c2ec56f3e529aed79bd37df7.zip | |
Auto merge of #108112 - nnethercote:clarify-iterator-interners, r=oli-obk,compiler-errors
Clarify iterator interners I found the iterator interners very confusing. This PR clarifies things. r? `@compiler-errors`
Diffstat (limited to 'compiler/rustc_trait_selection/src/solve')
| -rw-r--r-- | compiler/rustc_trait_selection/src/solve/trait_goals.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/solve/trait_goals/structural_traits.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/trait_goals.rs b/compiler/rustc_trait_selection/src/solve/trait_goals.rs index 0921fb5756d..d12e5f797fb 100644 --- a/compiler/rustc_trait_selection/src/solve/trait_goals.rs +++ b/compiler/rustc_trait_selection/src/solve/trait_goals.rs @@ -359,7 +359,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { let b_last_ty = b_tys.last().unwrap(); // Substitute just the tail field of B., and require that they're equal. - let unsized_a_ty = tcx.mk_tup(a_rest_tys.iter().chain([b_last_ty])); + let unsized_a_ty = tcx.mk_tup(a_rest_tys.iter().chain([b_last_ty]).copied()); let mut nested_goals = ecx.infcx.eq(goal.param_env, unsized_a_ty, b_ty)?; // Similar to ADTs, require that the rest of the fields are equal. diff --git a/compiler/rustc_trait_selection/src/solve/trait_goals/structural_traits.rs b/compiler/rustc_trait_selection/src/solve/trait_goals/structural_traits.rs index b6847b976be..3662463178f 100644 --- a/compiler/rustc_trait_selection/src/solve/trait_goals/structural_traits.rs +++ b/compiler/rustc_trait_selection/src/solve/trait_goals/structural_traits.rs @@ -191,10 +191,10 @@ pub(crate) fn extract_tupled_inputs_and_output_from_callable<'tcx>( ty::FnDef(def_id, substs) => Ok(Some( tcx.fn_sig(def_id) .subst(tcx, substs) - .map_bound(|sig| (tcx.mk_tup(sig.inputs().iter()), sig.output())), + .map_bound(|sig| (tcx.intern_tup(sig.inputs()), sig.output())), )), ty::FnPtr(sig) => { - Ok(Some(sig.map_bound(|sig| (tcx.mk_tup(sig.inputs().iter()), sig.output())))) + Ok(Some(sig.map_bound(|sig| (tcx.intern_tup(sig.inputs()), sig.output())))) } ty::Closure(_, substs) => { let closure_substs = substs.as_closure(); |
