Skip to content

Commit 95cd4a6

Browse files
committed
address review comments
1 parent db1a1d1 commit 95cd4a6

82 files changed

Lines changed: 153 additions & 153 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/rustc_middle/src/ty/print/pretty.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
899899
if !self.should_print_verbose() {
900900
write!(self, "{coroutine_kind}")?;
901901
if self.should_truncate() {
902-
write!(self, "@...}}")?;
902+
write!(self, "}}")?;
903903
return Ok(());
904904
} else if coroutine_kind.is_fn_like() {
905905
// If we are printing an `async fn` coroutine type, then give the path
@@ -967,7 +967,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
967967
if !self.should_print_verbose() {
968968
write!(self, "closure")?;
969969
if self.should_truncate() {
970-
write!(self, "@...}}")?;
970+
write!(self, "}}")?;
971971
return Ok(());
972972
} else {
973973
if let Some(did) = did.as_local() {
@@ -1031,7 +1031,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
10311031
),
10321032
}
10331033
if self.should_truncate() {
1034-
write!(self, "@...}}")?;
1034+
write!(self, "}}")?;
10351035
return Ok(());
10361036
} else if let Some(did) = did.as_local() {
10371037
if self.tcx().sess.opts.unstable_opts.span_free_formats {
@@ -2426,7 +2426,7 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
24262426
{
24272427
// We only truncate types that we know are likely to be much longer than 3 chars.
24282428
// There's no point in replacing `i32` or `!`.
2429-
write!(self, "...")?;
2429+
write!(self, "_")?;
24302430
Ok(())
24312431
}
24322432
ty::Ref(..) if self.should_truncate() && has_regions => self.pretty_print_type(ty),

tests/ui/async-await/async-closures/higher-ranked-return.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: lifetime may not live long enough
44
LL | let x = async move |x: &str| -> &str {
55
| ________________________________-________----_^
66
| | | |
7-
| | | return type of async closure `{async closure body@...}` contains a lifetime `'2`
7+
| | | return type of async closure `{async closure body}` contains a lifetime `'2`
88
| | let's call the lifetime of this reference `'1`
99
LL | | x
1010
LL | | };

tests/ui/async-await/async-closures/not-lending.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: lifetime may not live long enough
44
LL | let x = async move || -> &String { &s };
55
| ------------------------ ^^^^^^ returning this value requires that `'1` must outlive `'2`
66
| | |
7-
| | return type of async closure `{async closure body@...}` contains a lifetime `'2`
7+
| | return type of async closure `{async closure body}` contains a lifetime `'2`
88
| lifetime `'1` represents this closure's body
99
|
1010
= note: closure implements `AsyncFn`, so references to captured variables can't escape the closure
@@ -15,7 +15,7 @@ error: lifetime may not live long enough
1515
LL | let x = async move || { &s };
1616
| ------------- ^^^^^^ returning this value requires that `'1` must outlive `'2`
1717
| | |
18-
| | return type of async closure `{async closure body@...}` contains a lifetime `'2`
18+
| | return type of async closure `{async closure body}` contains a lifetime `'2`
1919
| lifetime `'1` represents this closure's body
2020
|
2121
= note: closure implements `AsyncFn`, so references to captured variables can't escape the closure

tests/ui/async-await/higher-ranked-auto-trait-15.no_assumptions.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: implementation of `FnOnce` is not general enough
44
LL | require_send(future);
55
| ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
66
|
7-
= note: closure with signature `fn(&'0 ...) -> Iter<'_, i32>` must implement `FnOnce<(&'1 Vec<i32>,)>`, for any two lifetimes `'0` and `'1`...
7+
= note: closure with signature `fn(&'0 _) -> Iter<'_, i32>` must implement `FnOnce<(&'1 Vec<i32>,)>`, for any two lifetimes `'0` and `'1`...
88
= note: ...but it actually implements `FnOnce<(&Vec<i32>,)>`
99
help: consider adding an explicit type annotation to the closure's argument
1010
|
@@ -17,7 +17,7 @@ error: implementation of `FnOnce` is not general enough
1717
LL | require_send(future);
1818
| ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
1919
|
20-
= note: closure with signature `fn(&'0 ...) -> Iter<'_, i32>` must implement `FnOnce<(&'1 Vec<i32>,)>`, for any two lifetimes `'0` and `'1`...
20+
= note: closure with signature `fn(&'0 _) -> Iter<'_, i32>` must implement `FnOnce<(&'1 Vec<i32>,)>`, for any two lifetimes `'0` and `'1`...
2121
= note: ...but it actually implements `FnOnce<(&Vec<i32>,)>`
2222
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2323
help: consider adding an explicit type annotation to the closure's argument

tests/ui/async-await/higher-ranked-auto-trait-16.assumptions.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | commit_if_ok(&mut ctxt, async |_| todo!()).await;
66
LL | | });
77
| |______^ implementation of `AsyncFnOnce` is not general enough
88
|
9-
= note: `{async closure@...}` must implement `AsyncFnOnce<(&mut Ctxt<'1>,)>`, for any two lifetimes `'0` and `'1`...
9+
= note: `{async closure}` must implement `AsyncFnOnce<(&mut Ctxt<'1>,)>`, for any two lifetimes `'0` and `'1`...
1010
= note: ...but it actually implements `AsyncFnOnce<(&mut Ctxt<'_>,)>`
1111

1212
error: implementation of `AsyncFnOnce` is not general enough
@@ -17,7 +17,7 @@ LL | | commit_if_ok(&mut ctxt, async |_| todo!()).await;
1717
LL | | });
1818
| |______^ implementation of `AsyncFnOnce` is not general enough
1919
|
20-
= note: `{async closure@...}` must implement `AsyncFnOnce<(&mut Ctxt<'1>,)>`, for any two lifetimes `'0` and `'1`...
20+
= note: `{async closure}` must implement `AsyncFnOnce<(&mut Ctxt<'1>,)>`, for any two lifetimes `'0` and `'1`...
2121
= note: ...but it actually implements `AsyncFnOnce<(&mut Ctxt<'_>,)>`
2222
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2323

tests/ui/async-await/higher-ranked-auto-trait-16.no_assumptions.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | commit_if_ok(&mut ctxt, async |_| todo!()).await;
66
LL | | });
77
| |______^ implementation of `AsyncFnOnce` is not general enough
88
|
9-
= note: `{async closure@...}` must implement `AsyncFnOnce<(&mut Ctxt<'1>,)>`, for any two lifetimes `'0` and `'1`...
9+
= note: `{async closure}` must implement `AsyncFnOnce<(&mut Ctxt<'1>,)>`, for any two lifetimes `'0` and `'1`...
1010
= note: ...but it actually implements `AsyncFnOnce<(&mut Ctxt<'_>,)>`
1111

1212
error: implementation of `AsyncFnOnce` is not general enough
@@ -17,7 +17,7 @@ LL | | commit_if_ok(&mut ctxt, async |_| todo!()).await;
1717
LL | | });
1818
| |______^ implementation of `AsyncFnOnce` is not general enough
1919
|
20-
= note: `{async closure@...}` must implement `AsyncFnOnce<(&mut Ctxt<'1>,)>`, for any two lifetimes `'0` and `'1`...
20+
= note: `{async closure}` must implement `AsyncFnOnce<(&mut Ctxt<'1>,)>`, for any two lifetimes `'0` and `'1`...
2121
= note: ...but it actually implements `AsyncFnOnce<(&mut Ctxt<'_>,)>`
2222
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2323

tests/ui/async-await/issue-74072-lifetime-name-annotations.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ error: lifetime may not live long enough
2929
LL | (async move || {
3030
| ______-------------_^
3131
| | | |
32-
| | | return type of async closure `{async closure body@...}` contains a lifetime `'2`
32+
| | | return type of async closure `{async closure body}` contains a lifetime `'2`
3333
| | lifetime `'1` represents this closure's body
3434
LL | |
3535
LL | |
@@ -78,7 +78,7 @@ error: lifetime may not live long enough
7878
LL | (async move || -> &i32 {
7979
| ______---------------------_^
8080
| | | |
81-
| | | return type of async closure `{async closure body@...}` contains a lifetime `'2`
81+
| | | return type of async closure `{async closure body}` contains a lifetime `'2`
8282
| | lifetime `'1` represents this closure's body
8383
LL | |
8484
LL | |

tests/ui/borrowck/closure-upvar-named-lifetime.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ error[E0700]: hidden type for `impl Fn(RefCell<HashMap<String, String>>)` captur
3939
--> $DIR/closure-upvar-named-lifetime.rs:17:5
4040
|
4141
LL | fn apply<'a>(
42-
| -- hidden type `{closure@...}` captures the lifetime `'a` as defined here
42+
| -- hidden type `{closure}` captures the lifetime `'a` as defined here
4343
LL | f: Arc<dyn Fn(Entry<'a, String, String>) + 'a>,
4444
LL | ) -> impl Fn(RefCell<HashMap<String, String>>)
4545
| ----------------------------------------- opaque type defined here
@@ -92,7 +92,7 @@ error[E0700]: hidden type for `impl Fn(RefCell<HashMap<String, String>>)` captur
9292
--> $DIR/closure-upvar-named-lifetime.rs:32:5
9393
|
9494
LL | fn apply_box<'a>(
95-
| -- hidden type `{closure@...}` captures the lifetime `'a` as defined here
95+
| -- hidden type `{closure}` captures the lifetime `'a` as defined here
9696
LL | f: Box<dyn Fn(Entry<'a, String, String>) + 'a>,
9797
LL | ) -> impl Fn(RefCell<HashMap<String, String>>)
9898
| ----------------------------------------- opaque type defined here

tests/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: lifetime may not live long enough
44
LL | let _action = move || {
55
| -------
66
| | |
7-
| | return type of closure `{closure@...}` contains a lifetime `'2`
7+
| | return type of closure `{closure}` contains a lifetime `'2`
88
| lifetime `'1` represents this closure's body
99
LL | || f() // The `nested` closure
1010
| ^^^^^^ returning this value requires that `'1` must outlive `'2`

tests/ui/borrowck/issue-95079-missing-move-in-nested-closure.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ error: lifetime may not live long enough
2424
LL | move |()| s.chars().map(|c| format!("{}{}", c, s))
2525
| --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2`
2626
| | |
27-
| | return type of closure `Map<Chars<'_>, {closure@...}>` contains a lifetime `'2`
27+
| | return type of closure `Map<Chars<'_>, {closure}>` contains a lifetime `'2`
2828
| lifetime `'1` represents this closure's body
2929
|
3030
= note: closure implements `Fn`, so references to captured variables can't escape the closure

0 commit comments

Comments
 (0)