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:
parent
4ed1376490
commit
3debf5006a
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: reached the recursion limit while instantiating `<(&(&(_, _), _), _) as Foo>::recurse`
|
||||
error: reached the recursion limit while instantiating `<(&(&(..., ...), ...), ...) as Foo>::recurse`
|
||||
--> $DIR/issue-37311.rs:17:9
|
||||
|
|
||||
LL | (self, self).recurse();
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut _>`
|
||||
error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut ...>`
|
||||
--> $DIR/issue-67552.rs:29:9
|
||||
|
|
||||
LL | rec(identity(&mut it))
|
||||
|
@ -14,7 +14,7 @@ error[E0275]: overflow evaluating the requirement `<std::ops::Range<u8> as Itera
|
||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_83150`)
|
||||
= note: required for `Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:12:24: 12:27]>` to implement `Iterator`
|
||||
= note: 64 redundant requirements hidden
|
||||
= note: required for `&mut Map<&mut Map<&mut Map<_, _>, _>, _>` to implement `Iterator`
|
||||
= note: required for `&mut Map<&mut Map<&mut Map<..., ...>, ...>, ...>` to implement `Iterator`
|
||||
= note: the full type name has been written to '$TEST_BUILD_DIR/recursion/issue-83150/issue-83150.long-type-hash.txt'
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
@ -17,7 +17,7 @@ error[E0275]: overflow evaluating the requirement `(): Sized`
|
||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "512"]` attribute to your crate (`issue_91949_hangs_on_recursion`)
|
||||
= note: required for `std::iter::Empty<()>` to implement `Iterator`
|
||||
= note: 171 redundant requirements hidden
|
||||
= note: required for `IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<..., _>>, _>>` to implement `Iterator`
|
||||
= note: required for `IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<..., ...>>, ...>>` to implement `Iterator`
|
||||
= note: the full type name has been written to '$TEST_BUILD_DIR/traits/issue-91949-hangs-on-recursion/issue-91949-hangs-on-recursion.long-type-hash.txt'
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: reached the type-length limit while instantiating `std::mem::drop::<Option<((((_, _, _), _, _), _, _), _, _)>>`
|
||||
error: reached the type-length limit while instantiating `std::mem::drop::<Option<((((..., ..., ...), ..., ...), ..., ...), ..., ...)>>`
|
||||
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
||||
|
|
||||
LL | pub fn drop<T>(_x: T) {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user