diff --git a/src/librustc/traits/auto_trait.rs b/src/librustc/traits/auto_trait.rs
index 4d52d7132df..db8f59ce954 100644
--- a/src/librustc/traits/auto_trait.rs
+++ b/src/librustc/traits/auto_trait.rs
@@ -55,7 +55,7 @@ impl AutoTraitResult {
pub struct AutoTraitInfo<'cx> {
pub full_user_env: ty::ParamEnv<'cx>,
pub region_data: RegionConstraintData<'cx>,
- pub names_map: FxHashMap,
+ pub names_map: FxHashSet,
pub vid_to_region: FxHashMap>,
}
@@ -206,12 +206,10 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
)
});
- let names_map: FxHashMap = generics
+ let names_map: FxHashSet = 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
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs
index 58ee42402d5..f8c0c404430 100644
--- a/src/librustdoc/clean/auto_trait.rs
+++ b/src/librustdoc/clean/auto_trait.rs
@@ -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);