diff options
| author | jackh726 <jack.huey@umassmed.edu> | 2021-11-25 21:16:27 -0500 |
|---|---|---|
| committer | jackh726 <jack.huey@umassmed.edu> | 2021-11-25 21:16:27 -0500 |
| commit | eeaa215f85b17756d68e41615f0f69fdf9802058 (patch) | |
| tree | 7376d2ac0f1dc4b8d6be4255dc107d357511ac2f /compiler/rustc_borrowck/src | |
| parent | eee8b9c7bafade55981d155dae71657f1cc55a22 (diff) | |
| download | rust-eeaa215f85b17756d68e41615f0f69fdf9802058.tar.gz rust-eeaa215f85b17756d68e41615f0f69fdf9802058.zip | |
Don't treat unnormalized function arguments as well-formed
Diffstat (limited to 'compiler/rustc_borrowck/src')
| -rw-r--r-- | compiler/rustc_borrowck/src/type_check/free_region_relations.rs | 6 |
1 files changed, 2 insertions, 4 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 f71cf09ecf6..8d97c3cbb0b 100644 --- a/compiler/rustc_borrowck/src/type_check/free_region_relations.rs +++ b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs @@ -256,7 +256,6 @@ impl UniversalRegionRelationsBuilder<'cx, 'tcx> { debug!("build: input_or_output={:?}", ty); // We add implied bounds from both the unnormalized and normalized ty // See issue #87748 - let constraints_implied_1 = self.add_implied_bounds(ty); let TypeOpOutput { output: norm_ty, constraints: constraints1, .. } = self .param_env .and(type_op::normalize::Normalize::new(ty)) @@ -284,10 +283,9 @@ impl UniversalRegionRelationsBuilder<'cx, 'tcx> { // } // ``` // Both &Self::Bar and &() are WF - let constraints_implied_2 = - if ty != norm_ty { self.add_implied_bounds(norm_ty) } else { None }; + let constraints_implied = self.add_implied_bounds(norm_ty); normalized_inputs_and_output.push(norm_ty); - constraints1.into_iter().chain(constraints_implied_1).chain(constraints_implied_2) + constraints1.into_iter().chain(constraints_implied) }) .collect(); |
