Simplified name mapping in auto trait handling.
This commit is contained in:
parent
d101753cd8
commit
388defad2d
@ -55,7 +55,7 @@ impl<A> AutoTraitResult<A> {
|
||||
pub struct AutoTraitInfo<'cx> {
|
||||
pub full_user_env: ty::ParamEnv<'cx>,
|
||||
pub region_data: RegionConstraintData<'cx>,
|
||||
pub names_map: FxHashMap<String, String>,
|
||||
pub names_map: FxHashSet<String>,
|
||||
pub vid_to_region: FxHashMap<ty::RegionVid, ty::Region<'cx>>,
|
||||
}
|
||||
|
||||
@ -206,12 +206,10 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
|
||||
)
|
||||
});
|
||||
|
||||
let names_map: FxHashMap<String, String> = generics
|
||||
let names_map: FxHashSet<String> = generics
|
||||
.regions
|
||||
.iter()
|
||||
.map(|l| (l.name.to_string(), l.name.to_string()))
|
||||
// TODO(twk): Lifetime branding and why is this map a set?!
|
||||
// l.clean(self.cx) was present in the original code
|
||||
.map(|l| l.name.to_string())
|
||||
.collect();
|
||||
|
||||
let body_ids: FxHashSet<_> = infcx
|
||||
|
@ -290,7 +290,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
|
||||
let names_map =
|
||||
info.names_map
|
||||
.drain()
|
||||
.map(|(name, lifetime)| (name, Lifetime(lifetime)))
|
||||
.map(|name| (name.clone(), Lifetime(name)))
|
||||
.collect();
|
||||
let lifetime_predicates =
|
||||
self.handle_lifetimes(®ion_data, &names_map);
|
||||
|
Loading…
x
Reference in New Issue
Block a user