about summary refs log tree commit diff
path: root/src/tools/clippy
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-22 15:19:38 +0000
committerbors <bors@rust-lang.org>2023-09-22 15:19:38 +0000
commit959b2c703d45f06962da3afa086bdda70d42efcf (patch)
tree3fcd95b0de658e25157685270746b934c8f73154 /src/tools/clippy
parent01903944d8c7e3cfdba88c9c7dbc09475b37d986 (diff)
parentc4ec12f4b701d9be95143f3fa77b1f1af07de18c (diff)
downloadrust-959b2c703d45f06962da3afa086bdda70d42efcf.tar.gz
rust-959b2c703d45f06962da3afa086bdda70d42efcf.zip
Auto merge of #115696 - RalfJung:closure-ty-print, r=oli-obk
adjust how closure/generator types are printed

I saw `&[closure@$DIR/issue-20862.rs:2:5]` and I thought it is a slice type, because that's usually what `&[_]` is... it took me a while to realize that this is just a confusing printer and actually there's no slice. Let's use something that cannot be mistaken for a regular type.
Diffstat (limited to 'src/tools/clippy')
-rw-r--r--src/tools/clippy/tests/ui/box_default.fixed2
-rw-r--r--src/tools/clippy/tests/ui/box_default.rs2
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-6251.stderr2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/clippy/tests/ui/box_default.fixed b/src/tools/clippy/tests/ui/box_default.fixed
index 22c034c88ab..69cabcb32d3 100644
--- a/src/tools/clippy/tests/ui/box_default.fixed
+++ b/src/tools/clippy/tests/ui/box_default.fixed
@@ -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());
diff --git a/src/tools/clippy/tests/ui/box_default.rs b/src/tools/clippy/tests/ui/box_default.rs
index 89e3888ba21..48fa8bc33bc 100644
--- a/src/tools/clippy/tests/ui/box_default.rs
+++ b/src/tools/clippy/tests/ui/box_default.rs
@@ -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());
diff --git a/src/tools/clippy/tests/ui/crashes/ice-6251.stderr b/src/tools/clippy/tests/ui/crashes/ice-6251.stderr
index 68a5766c90c..11081dc8087 100644
--- a/src/tools/clippy/tests/ui/crashes/ice-6251.stderr
+++ b/src/tools/clippy/tests/ui/crashes/ice-6251.stderr
@@ -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