adjust how closure/generator types and rvalues are printed

This commit is contained in:
Ralf Jung 2023-09-09 08:36:50 +02:00
parent b30cefc775
commit 1fac304bf5
3 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ fn main() {
issue_10381();
// `Box::<Option<_>>::default()` would be valid here, but not `Box::default()` or
// `Box::<Option<[closure@...]>::default()`
// `Box::<Option<{closure@...}>::default()`
//
// Would have a suggestion after https://github.com/rust-lang/rust/blob/fdd030127cc68afec44a8d3f6341525dd34e50ae/compiler/rustc_middle/src/ty/diagnostics.rs#L554-L563
let mut unnameable = Box::new(Option::default());

View File

@ -36,7 +36,7 @@ fn main() {
issue_10381();
// `Box::<Option<_>>::default()` would be valid here, but not `Box::default()` or
// `Box::<Option<[closure@...]>::default()`
// `Box::<Option<{closure@...}>::default()`
//
// Would have a suggestion after https://github.com/rust-lang/rust/blob/fdd030127cc68afec44a8d3f6341525dd34e50ae/compiler/rustc_middle/src/ty/diagnostics.rs#L554-L563
let mut unnameable = Box::new(Option::default());

View File

@ -27,7 +27,7 @@ LL | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| x }]> {
| ^^^^^^^^^^^ expected `usize`, found closure
|
= note: expected type `usize`
found closure `[closure@$DIR/ice-6251.rs:4:44: 4:53]`
found closure `{closure@$DIR/ice-6251.rs:4:44: 4:53}`
error: aborting due to 3 previous errors