diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-03-31 17:29:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-31 17:29:54 +0200 |
| commit | 1f86789bb3a67c21b88c0f4050d4794de2a128ba (patch) | |
| tree | 03bc7ae2cecaf9ed436211148558a25498399cd8 /compiler/rustc_borrowck | |
| parent | eb0e8c3418fd4f89743b5b12c84e4f683748ea1a (diff) | |
| parent | 89c66eb42d385975c91d79de139b50c298414d71 (diff) | |
| download | rust-1f86789bb3a67c21b88c0f4050d4794de2a128ba.tar.gz rust-1f86789bb3a67c21b88c0f4050d4794de2a128ba.zip | |
Rollup merge of #95517 - lcnr:rustc_borrowck-misc, r=jackh726
small rustc_borrowck cleanup r? `@jackh726` because of the second commit, seems like that comment was missed in #91243
Diffstat (limited to 'compiler/rustc_borrowck')
| -rw-r--r-- | compiler/rustc_borrowck/src/type_check/free_region_relations.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/type_check/mod.rs | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/compiler/rustc_borrowck/src/type_check/free_region_relations.rs b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs index 0b9d0a0e922..f8439d2e163 100644 --- a/compiler/rustc_borrowck/src/type_check/free_region_relations.rs +++ b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs @@ -253,8 +253,10 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> { let constraint_sets: Vec<_> = unnormalized_input_output_tys .flat_map(|ty| { debug!("build: input_or_output={:?}", ty); - // We add implied bounds from both the unnormalized and normalized ty - // See issue #87748 + // We only add implied bounds for the normalized type as the unnormalized + // type may not actually get checked by the caller. + // + // Can otherwise be unsound, see #91068. let TypeOpOutput { output: norm_ty, constraints: constraints1, .. } = self .param_env .and(type_op::normalize::Normalize::new(ty)) diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 7dc292ffb65..e9fa33f656f 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -1899,7 +1899,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { ObligationCause::new( span, self.tcx().hir().local_def_id_to_hir_id(def_id), - traits::ObligationCauseCode::RepeatVec(is_const_fn), + traits::ObligationCauseCode::RepeatElementCopy { + is_const_fn, + }, ), self.param_env, ty::Binder::dummy(ty::TraitRef::new( |
