Skip to content

Commit

Permalink
Put the dots back
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Jul 15, 2024
1 parent eb72697 commit f2a0a5e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1214,11 +1214,14 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
&& let ty::Alias(_, alias_ty) =
self.tcx().fn_sig(fn_def_id).skip_binder().output().skip_binder().kind()
&& alias_ty.def_id == def_id
&& let generics = self.tcx().generics_of(fn_def_id)
// FIXME(return_type_notation): We only support lifetime params for now.
&& generics.own_params.iter().all(|param| matches!(param.kind, ty::GenericParamDefKind::Lifetime))
{
let num_args = self.tcx().generics_of(fn_def_id).count();
let num_args = generics.count();
write!(self, " {{ ")?;
self.print_def_path(fn_def_id, &args[..num_args])?;
write!(self, "() }}")?;
write!(self, "(..) }}")?;
}

Ok(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ error: future cannot be sent between threads safely
LL | is_send(foo::<T>());
| ^^^^^^^^^^ future returned by `foo` is not `Send`
|
= 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`
= 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`
note: future is not `Send` as it awaits another future which is not `Send`
--> $DIR/basic.rs:13:5
|
LL | T::method().await?;
| ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`, which is not `Send`
| ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>> { <T as Foo>::method(..) }`, which is not `Send`
note: required by a bound in `is_send`
--> $DIR/basic.rs:17:20
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ LL | | }
LL | | });
| |______^ implementation of `Send` is not general enough
|
= 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`...
= note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>() }`, for some specific lifetime `'2`
= 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`...
= note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>(..) }`, for some specific lifetime `'2`

error: implementation of `Send` is not general enough
--> $DIR/issue-110963-early.rs:14:5
Expand All @@ -32,8 +32,8 @@ LL | | }
LL | | });
| |______^ implementation of `Send` is not general enough
|
= 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`...
= note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>() }`, for some specific lifetime `'2`
= 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`...
= note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>(..) }`, for some specific lifetime `'2`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

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

0 comments on commit f2a0a5e

Please sign in to comment.