Skip to content

Commit 97668a5

Browse files
We can print futures with {integer} too
1 parent 2c94102 commit 97668a5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ pub trait PrettyPrinter<'tcx>:
923923
{
924924
if let ty::Generator(_, substs, _) = substs.type_at(0).kind() {
925925
let return_ty = substs.as_generator().return_ty();
926-
if !return_ty.is_ty_infer() {
926+
if !return_ty.is_ty_var() {
927927
return_ty.into()
928928
} else {
929929
continue;

src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr

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

0 commit comments

Comments
 (0)