Auto merge of #87287 - oli-obk:fixup_fixup_fixup_opaque_types, r=spastorino
Make mir borrowck's use of opaque types independent of the typeck query's result fixes #87218 fixes #86465 we used to use the typeck results only to generate an obligation for the mir borrowck type to be equal to the typeck result. When i removed the `fixup_opaque_types` function in #87200, I exposed a bug that showed that mir borrowck can't doesn't get enough information from typeck in order to build the correct lifetime mapping from opaque type usage to the actual concrete type. We therefor now fully compute the information within mir borrowck (we already did that, but we only used it to verify the typeck result) and stop using the typeck information. We will likely be able to remove most opaque type information from the borrowck results in the future and just have all current callers use the mir borrowck result instead. r? `@spastorino`
This commit is contained in:
commit
b2b7c859c1
30 changed files with 206 additions and 301 deletions
|
@ -24,6 +24,7 @@
|
|||
#![feature(new_uninit)]
|
||||
#![feature(once_cell)]
|
||||
#![feature(maybe_uninit_uninit_array)]
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![allow(rustc::default_hash_types)]
|
||||
#![deny(unaligned_references)]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::borrow::Borrow;
|
||||
use std::iter::FromIterator;
|
||||
use std::slice::{Iter, IterMut};
|
||||
use std::slice::Iter;
|
||||
use std::vec::IntoIter;
|
||||
|
||||
use crate::stable_hasher::{HashStable, StableHasher};
|
||||
|
@ -67,9 +67,13 @@ where
|
|||
self.into_iter()
|
||||
}
|
||||
|
||||
pub fn iter_mut(&mut self) -> IterMut<'_, (K, V)> {
|
||||
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&K, &mut V)> {
|
||||
self.into_iter()
|
||||
}
|
||||
|
||||
pub fn retain(&mut self, f: impl Fn(&(K, V)) -> bool) {
|
||||
self.0.retain(f)
|
||||
}
|
||||
}
|
||||
|
||||
impl<K, V> Default for VecMap<K, V> {
|
||||
|
@ -108,12 +112,12 @@ impl<'a, K, V> IntoIterator for &'a VecMap<K, V> {
|
|||
}
|
||||
|
||||
impl<'a, K, V> IntoIterator for &'a mut VecMap<K, V> {
|
||||
type Item = &'a mut (K, V);
|
||||
type IntoIter = IterMut<'a, (K, V)>;
|
||||
type Item = (&'a K, &'a mut V);
|
||||
type IntoIter = impl Iterator<Item = Self::Item>;
|
||||
|
||||
#[inline]
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.0.iter_mut()
|
||||
self.0.iter_mut().map(|(k, v)| (&*k, v))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue