Skip to content

Commit f2a0a5e

Browse files
Put the dots back
1 parent eb72697 commit f2a0a5e

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -1214,11 +1214,14 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
12141214
&& let ty::Alias(_, alias_ty) =
12151215
self.tcx().fn_sig(fn_def_id).skip_binder().output().skip_binder().kind()
12161216
&& alias_ty.def_id == def_id
1217+
&& let generics = self.tcx().generics_of(fn_def_id)
1218+
// FIXME(return_type_notation): We only support lifetime params for now.
1219+
&& generics.own_params.iter().all(|param| matches!(param.kind, ty::GenericParamDefKind::Lifetime))
12171220
{
1218-
let num_args = self.tcx().generics_of(fn_def_id).count();
1221+
let num_args = generics.count();
12191222
write!(self, " {{ ")?;
12201223
self.print_def_path(fn_def_id, &args[..num_args])?;
1221-
write!(self, "() }}")?;
1224+
write!(self, "(..) }}")?;
12221225
}
12231226

12241227
Ok(())

tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ error: future cannot be sent between threads safely
1313
LL | is_send(foo::<T>());
1414
| ^^^^^^^^^^ future returned by `foo` is not `Send`
1515
|
16-
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`, which is required by `impl Future<Output = Result<(), ()>>: Send`
16+
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method(..) }`, which is required by `impl Future<Output = Result<(), ()>>: Send`
1717
note: future is not `Send` as it awaits another future which is not `Send`
1818
--> $DIR/basic.rs:13:5
1919
|
2020
LL | T::method().await?;
21-
| ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`, which is not `Send`
21+
| ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>> { <T as Foo>::method(..) }`, which is not `Send`
2222
note: required by a bound in `is_send`
2323
--> $DIR/basic.rs:17:20
2424
|

tests/ui/async-await/return-type-notation/issue-110963-early.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ LL | | }
1818
LL | | });
1919
| |______^ implementation of `Send` is not general enough
2020
|
21-
= note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>() }`, for any two lifetimes `'0` and `'1`...
22-
= note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>() }`, for some specific lifetime `'2`
21+
= note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>(..) }`, for any two lifetimes `'0` and `'1`...
22+
= note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>(..) }`, for some specific lifetime `'2`
2323

2424
error: implementation of `Send` is not general enough
2525
--> $DIR/issue-110963-early.rs:14:5
@@ -32,8 +32,8 @@ LL | | }
3232
LL | | });
3333
| |______^ implementation of `Send` is not general enough
3434
|
35-
= note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>() }`, for any two lifetimes `'0` and `'1`...
36-
= note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>() }`, for some specific lifetime `'2`
35+
= note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>(..) }`, for any two lifetimes `'0` and `'1`...
36+
= note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>(..) }`, for some specific lifetime `'2`
3737
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3838

3939
error: aborting due to 2 previous errors; 1 warning emitted

0 commit comments

Comments
 (0)