We can print futures with {integer} too

This commit is contained in:
Michael Goulet 2022-09-08 02:42:00 +00:00
parent 2c94102df5
commit 97668a5589
2 changed files with 2 additions and 2 deletions
compiler/rustc_middle/src/ty/print
src/test/ui/suggestions

View File

@ -923,7 +923,7 @@ fn pretty_print_opaque_impl_type(
{
if let ty::Generator(_, substs, _) = substs.type_at(0).kind() {
let return_ty = substs.as_generator().return_ty();
if !return_ty.is_ty_infer() {
if !return_ty.is_ty_var() {
return_ty.into()
} else {
continue;

View File

@ -91,7 +91,7 @@ LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
| ------------------------------- the found opaque type
|
= note: expected struct `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>`
found opaque type `impl Future`
found opaque type `impl Future<Output = {integer}>`
help: you need to pin and box this expression
|
LL ~ Box::pin(async {