1
Fork 0

Only use ... instead of _ for type elision

`_` might confuse people into believing that the type isn't known,
while `...` is not used anywhere else for types and is not valid
syntax, making it more likely to convey the right understanding.
This commit is contained in:
Esteban Küber 2022-11-16 20:07:15 -08:00
parent 4ed1376490
commit 3debf5006a
6 changed files with 6 additions and 10 deletions

View file

@ -1765,11 +1765,7 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
self.pretty_print_type(ty)
} else {
self.truncated = true;
if let ty::Adt(_, substs) = ty.kind() && substs.len() > 0 {
write!(self, "...")?;
} else {
write!(self, "_")?;
}
write!(self, "...")?;
Ok(self)
}
}