Removed unnecessary special handling of VariantCtor defs in instantiate_value_path.

This commit is contained in:
Alexander Regueiro 2018-12-15 14:54:33 +00:00
parent 37e7f0a629
commit 65f50582cf

View File

@ -5316,22 +5316,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
}
}
}
Def::VariantCtor(_, _) if self_ty.is_some() => {
let def_id = def.def_id();
let ty = tcx.type_of(def_id);
if tcx.features().type_alias_enum_variants {
if let Some(self_ty) = self_ty {
match ty.ty_adt_def() {
Some(adt_def) if adt_def.is_enum() => {
return (self_ty, def);
}
_ => {}
}
}
}
(def_id, ty)
}
_ => {
let def_id = def.def_id();