about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-08 20:45:16 +0000
committerbors <bors@rust-lang.org>2022-04-08 20:45:16 +0000
commitf4a7ce997a1d7546d2b737f8b87d36907bcea2ad (patch)
treef8c9e6f48fe2df76768ce69b24115af86b1e88fa /compiler/rustc_data_structures/src
parent2d5a21f63c98f8a1d5f3c3af93bcb0a8af19af36 (diff)
parentb30bcfae38803443963797e219a5f1b174ebeb79 (diff)
downloadrust-f4a7ce997a1d7546d2b737f8b87d36907bcea2ad.tar.gz
rust-f4a7ce997a1d7546d2b737f8b87d36907bcea2ad.zip
Auto merge of #95519 - oli-obk:tait_ub2, r=compiler-errors
Enforce well formedness for type alias impl trait's hidden type

fixes #84657

This was not an issue with return-position-impl-trait because the generic bounds of the function are the same as those of the opaque type, and the hidden type must already be well formed within the function.

With type-alias-impl-trait the hidden type could be defined in a function that has *more* lifetime bounds than the type alias. This is fine, but the hidden type must still be well formed without those additional bounds.
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/vec_map.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/vec_map.rs b/compiler/rustc_data_structures/src/vec_map.rs
index 2f4b3844430..86be0bd8775 100644
--- a/compiler/rustc_data_structures/src/vec_map.rs
+++ b/compiler/rustc_data_structures/src/vec_map.rs
@@ -144,7 +144,7 @@ impl<'a, K, V> IntoIterator for &'a VecMap<K, V> {
     }
 }
 
-impl<'a, K, V> IntoIterator for &'a mut VecMap<K, V> {
+impl<'a, K: 'a, V: 'a> IntoIterator for &'a mut VecMap<K, V> {
     type Item = (&'a K, &'a mut V);
     type IntoIter = impl Iterator<Item = Self::Item>;