Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #107578

Closed
Closed
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a63f5dc
Remove confusing 'while checking' note from opaque future type mismat…
compiler-errors Jan 22, 2023
5209d6f
Remove hardcoded clang target: ios13 or ios14 for Mac Catalyst [fixed]
imWildCat Jan 27, 2023
72419ef
Recover _ as .. in field pattern
compiler-errors Jan 15, 2023
f1cb13e
Improve diagnostic for missing space in range pattern
clubby789 Jan 30, 2023
75e87d1
Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.
nnethercote Jan 30, 2023
b96c899
Rename `rust_2015` => `is_rust_2015`
WaffleLapkin Feb 1, 2023
7f8bf60
Use `rust_2018` instead of `!is_rust_2015`
WaffleLapkin Feb 1, 2023
63f82db
Inline CSS background images directly into the CSS
GuillaumeGomez Jan 31, 2023
fb38578
Add proc-macro boilerplate to crt-static test
Feb 1, 2023
619de1b
Revert "Teach parser to understand fake anonymous enum syntax" and re…
compiler-errors Jan 30, 2023
250f530
Add a test
compiler-errors Jan 30, 2023
c8f7387
Rollup merge of #106919 - compiler-errors:underscore-typo-in-field-pa…
compiler-errors Feb 2, 2023
a6b171d
Rollup merge of #106925 - imWildCat:imWildCat/remove-hardcoded-ios-ma…
compiler-errors Feb 2, 2023
9d959ea
Rollup merge of #107201 - compiler-errors:confusing-async-fn-note, r=…
compiler-errors Feb 2, 2023
93e9dac
Rollup merge of #107478 - compiler-errors:anon-enum-tys-are-ambiguous…
compiler-errors Feb 2, 2023
191ee56
Rollup merge of #107488 - nnethercote:fix-PartialEq-syntax, r=RalfJung
compiler-errors Feb 2, 2023
beb3f5d
Rollup merge of #107493 - clubby789:range-fat-arrow-followup, r=estebank
compiler-errors Feb 2, 2023
8c835be
Rollup merge of #107531 - GuillaumeGomez:inline-images-in-css, r=notr…
compiler-errors Feb 2, 2023
abd02cc
Rollup merge of #107559 - WaffleLapkin:is_it_2015¿, r=davidtwco
compiler-errors Feb 2, 2023
e3c0499
Rollup merge of #107576 - P1n3appl3:master, r=tmandry
compiler-errors Feb 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 16 additions & 46 deletions compiler/rustc_infer/src/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ use crate::traits::{

use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
use rustc_errors::{pluralize, struct_span_err, Diagnostic, ErrorGuaranteed, IntoDiagnosticArg};
use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString, MultiSpan};
use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
use rustc_hir as hir;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{DefId, LocalDefId};
@@ -1470,51 +1470,17 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
for (key, values) in types.iter() {
let count = values.len();
let kind = key.descr();
let mut returned_async_output_error = false;
for &sp in values {
if sp.is_desugaring(DesugaringKind::Async) && !returned_async_output_error {
if [sp] != err.span.primary_spans() {
let mut span: MultiSpan = sp.into();
span.push_span_label(
sp,
format!(
"checked the `Output` of this `async fn`, {}{} {}{}",
if count > 1 { "one of the " } else { "" },
target,
kind,
pluralize!(count),
),
);
err.span_note(
span,
"while checking the return type of the `async fn`",
);
} else {
err.span_label(
sp,
format!(
"checked the `Output` of this `async fn`, {}{} {}{}",
if count > 1 { "one of the " } else { "" },
target,
kind,
pluralize!(count),
),
);
err.note("while checking the return type of the `async fn`");
}
returned_async_output_error = true;
} else {
err.span_label(
sp,
format!(
"{}{} {}{}",
if count == 1 { "the " } else { "one of the " },
target,
kind,
pluralize!(count),
),
);
}
err.span_label(
sp,
format!(
"{}{} {}{}",
if count == 1 { "the " } else { "one of the " },
target,
kind,
pluralize!(count),
),
);
}
}
}
@@ -1537,7 +1503,11 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
// |
// = note: expected unit type `()`
// found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]`
if !self.ignore_span.overlaps(span) {
//
// Also ignore opaque `Future`s that come from async fns.
if !self.ignore_span.overlaps(span)
&& !span.is_desugaring(DesugaringKind::Async)
{
self.types.entry(kind).or_default().insert(span);
}
}
5 changes: 0 additions & 5 deletions tests/ui/async-await/dont-suggest-missing-await.stderr
Original file line number Diff line number Diff line change
@@ -6,11 +6,6 @@ LL | take_u32(x)
| |
| arguments to this function are incorrect
|
note: while checking the return type of the `async fn`
--> $DIR/dont-suggest-missing-await.rs:7:24
|
LL | async fn make_u32() -> u32 {
| ^^^ checked the `Output` of this `async fn`, found opaque type
= note: expected type `u32`
found opaque type `impl Future<Output = u32>`
note: function defined here
10 changes: 0 additions & 10 deletions tests/ui/async-await/generator-desc.stderr
Original file line number Diff line number Diff line change
@@ -21,16 +21,6 @@ LL | fun(one(), two());
| |
| arguments to this function are incorrect
|
note: while checking the return type of the `async fn`
--> $DIR/generator-desc.rs:5:16
|
LL | async fn one() {}
| ^ checked the `Output` of this `async fn`, expected opaque type
note: while checking the return type of the `async fn`
--> $DIR/generator-desc.rs:6:16
|
LL | async fn two() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:5:16>)
found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:6:16>)
= help: consider `await`ing on both `Future`s
3 changes: 0 additions & 3 deletions tests/ui/async-await/issue-61076.rs
Original file line number Diff line number Diff line change
@@ -54,9 +54,6 @@ async fn struct_() -> Struct {
}

async fn tuple() -> Tuple {
//~^ NOTE checked the `Output` of this `async fn`, expected opaque type
//~| NOTE while checking the return type of the `async fn`
//~| NOTE in this expansion of desugaring of `async` block or function
Tuple(1i32)
}

15 changes: 5 additions & 10 deletions tests/ui/async-await/issue-61076.stderr
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ LL | foo().await?;
| ++++++

error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> $DIR/issue-61076.rs:65:5
--> $DIR/issue-61076.rs:62:5
|
LL | t?;
| ^^ the `?` operator cannot be applied to type `T`
@@ -23,7 +23,7 @@ LL | t.await?;
| ++++++

error[E0609]: no field `0` on type `impl Future<Output = Tuple>`
--> $DIR/issue-61076.rs:74:26
--> $DIR/issue-61076.rs:71:26
|
LL | let _: i32 = tuple().0;
| ^ field not available in `impl Future`, but it is available in its `Output`
@@ -34,7 +34,7 @@ LL | let _: i32 = tuple().await.0;
| ++++++

error[E0609]: no field `a` on type `impl Future<Output = Struct>`
--> $DIR/issue-61076.rs:78:28
--> $DIR/issue-61076.rs:75:28
|
LL | let _: i32 = struct_().a;
| ^ field not available in `impl Future`, but it is available in its `Output`
@@ -45,7 +45,7 @@ LL | let _: i32 = struct_().await.a;
| ++++++

error[E0599]: no method named `method` found for opaque type `impl Future<Output = Struct>` in the current scope
--> $DIR/issue-61076.rs:82:15
--> $DIR/issue-61076.rs:79:15
|
LL | struct_().method();
| ^^^^^^ method not found in `impl Future<Output = Struct>`
@@ -56,19 +56,14 @@ LL | struct_().await.method();
| ++++++

error[E0308]: mismatched types
--> $DIR/issue-61076.rs:91:9
--> $DIR/issue-61076.rs:88:9
|
LL | match tuple() {
| ------- this expression has type `impl Future<Output = Tuple>`
LL |
LL | Tuple(_) => {}
| ^^^^^^^^ expected opaque type, found `Tuple`
|
note: while checking the return type of the `async fn`
--> $DIR/issue-61076.rs:56:21
|
LL | async fn tuple() -> Tuple {
| ^^^^^ checked the `Output` of this `async fn`, expected opaque type
= note: expected opaque type `impl Future<Output = Tuple>`
found struct `Tuple`
help: consider `await`ing on the `Future`
15 changes: 0 additions & 15 deletions tests/ui/async-await/issue-98634.stderr
Original file line number Diff line number Diff line change
@@ -4,11 +4,6 @@ error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Futu
LL | StructAsync { callback }.await;
| ^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
|
note: while checking the return type of the `async fn`
--> $DIR/issue-98634.rs:24:21
|
LL | async fn callback() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
found opaque type `impl Future<Output = ()>`
note: required by a bound in `StructAsync`
@@ -23,11 +18,6 @@ error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Futu
LL | StructAsync { callback }.await;
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
|
note: while checking the return type of the `async fn`
--> $DIR/issue-98634.rs:24:21
|
LL | async fn callback() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
found opaque type `impl Future<Output = ()>`
note: required by a bound in `StructAsync`
@@ -42,11 +32,6 @@ error[E0271]: expected `callback` to be a fn item that returns `Pin<Box<dyn Futu
LL | StructAsync { callback }.await;
| ^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
|
note: while checking the return type of the `async fn`
--> $DIR/issue-98634.rs:24:21
|
LL | async fn callback() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
found opaque type `impl Future<Output = ()>`
note: required by a bound in `StructAsync`
5 changes: 0 additions & 5 deletions tests/ui/async-await/issues/issue-102206.stderr
Original file line number Diff line number Diff line change
@@ -8,11 +8,6 @@ LL | std::mem::size_of_val(foo());
| | help: consider borrowing here: `&foo()`
| arguments to this function are incorrect
|
note: while checking the return type of the `async fn`
--> $DIR/issue-102206.rs:3:16
|
LL | async fn foo() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected reference `&_`
found opaque type `impl Future<Output = ()>`
note: function defined here
5 changes: 0 additions & 5 deletions tests/ui/async-await/suggest-missing-await-closure.stderr
Original file line number Diff line number Diff line change
@@ -6,11 +6,6 @@ LL | take_u32(x)
| |
| arguments to this function are incorrect
|
note: while checking the return type of the `async fn`
--> $DIR/suggest-missing-await-closure.rs:8:24
|
LL | async fn make_u32() -> u32 {
| ^^^ checked the `Output` of this `async fn`, found opaque type
= note: expected type `u32`
found opaque type `impl Future<Output = u32>`
note: function defined here
35 changes: 0 additions & 35 deletions tests/ui/async-await/suggest-missing-await.stderr
Original file line number Diff line number Diff line change
@@ -6,11 +6,6 @@ LL | take_u32(x)
| |
| arguments to this function are incorrect
|
note: while checking the return type of the `async fn`
--> $DIR/suggest-missing-await.rs:5:24
|
LL | async fn make_u32() -> u32 {
| ^^^ checked the `Output` of this `async fn`, found opaque type
= note: expected type `u32`
found opaque type `impl Future<Output = u32>`
note: function defined here
@@ -29,11 +24,6 @@ error[E0308]: mismatched types
LL | dummy()
| ^^^^^^^ expected `()`, found opaque type
|
note: while checking the return type of the `async fn`
--> $DIR/suggest-missing-await.rs:18:18
|
LL | async fn dummy() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected unit type `()`
found opaque type `impl Future<Output = ()>`
help: consider `await`ing on the `Future`
@@ -60,11 +50,6 @@ LL | |
LL | | };
| |_____- `if` and `else` have incompatible types
|
note: while checking the return type of the `async fn`
--> $DIR/suggest-missing-await.rs:18:18
|
LL | async fn dummy() {}
| ^ checked the `Output` of this `async fn`, expected opaque type
= note: expected opaque type `impl Future<Output = ()>`
found unit type `()`
help: consider `await`ing on the `Future`
@@ -87,11 +72,6 @@ LL | |
LL | | };
| |_____- `match` arms have incompatible types
|
note: while checking the return type of the `async fn`
--> $DIR/suggest-missing-await.rs:18:18
|
LL | async fn dummy() {}
| ^ checked the `Output` of this `async fn`, expected opaque type
= note: expected opaque type `impl Future<Output = ()>`
found unit type `()`
help: consider `await`ing on the `Future`
@@ -108,11 +88,6 @@ LL | let _x = match dummy() {
LL | () => {}
| ^^ expected opaque type, found `()`
|
note: while checking the return type of the `async fn`
--> $DIR/suggest-missing-await.rs:18:18
|
LL | async fn dummy() {}
| ^ checked the `Output` of this `async fn`, expected opaque type
= note: expected opaque type `impl Future<Output = ()>`
found unit type `()`
help: consider `await`ing on the `Future`
@@ -129,11 +104,6 @@ LL | match dummy_result() {
LL | Ok(_) => {}
| ^^^^^ expected opaque type, found `Result<_, _>`
|
note: while checking the return type of the `async fn`
--> $DIR/suggest-missing-await.rs:57:28
|
LL | async fn dummy_result() -> Result<(), ()> {
| ^^^^^^^^^^^^^^ checked the `Output` of this `async fn`, expected opaque type
= note: expected opaque type `impl Future<Output = Result<(), ()>>`
found enum `Result<_, _>`
help: consider `await`ing on the `Future`
@@ -150,11 +120,6 @@ LL | match dummy_result() {
LL | Err(_) => {}
| ^^^^^^ expected opaque type, found `Result<_, _>`
|
note: while checking the return type of the `async fn`
--> $DIR/suggest-missing-await.rs:57:28
|
LL | async fn dummy_result() -> Result<(), ()> {
| ^^^^^^^^^^^^^^ checked the `Output` of this `async fn`, expected opaque type
= note: expected opaque type `impl Future<Output = Result<(), ()>>`
found enum `Result<_, _>`
help: consider `await`ing on the `Future`
10 changes: 0 additions & 10 deletions tests/ui/impl-trait/in-trait/method-signature-matches.stderr
Original file line number Diff line number Diff line change
@@ -24,16 +24,6 @@ LL | async fn owo(_: u8) {}
| expected `()`, found `u8`
| help: change the parameter type to match the trait: `()`
|
note: while checking the return type of the `async fn`
--> $DIR/method-signature-matches.rs:20:25
|
LL | async fn owo(_: u8) {}
| ^ checked the `Output` of this `async fn`, expected opaque type
note: while checking the return type of the `async fn`
--> $DIR/method-signature-matches.rs:20:25
|
LL | async fn owo(_: u8) {}
| ^ checked the `Output` of this `async fn`, found opaque type
note: type in trait
--> $DIR/method-signature-matches.rs:16:21
|
5 changes: 0 additions & 5 deletions tests/ui/impl-trait/issue-102605.stderr
Original file line number Diff line number Diff line change
@@ -6,11 +6,6 @@ LL | convert_result(foo())
| |
| arguments to this function are incorrect
|
note: while checking the return type of the `async fn`
--> $DIR/issue-102605.rs:3:19
|
LL | async fn foo() -> Result<(), String> {
| ^^^^^^^^^^^^^^^^^^ checked the `Output` of this `async fn`, found opaque type
= note: expected enum `Result<(), _>`
found opaque type `impl Future<Output = Result<(), String>>`
note: function defined here
5 changes: 0 additions & 5 deletions tests/ui/impl-trait/issue-99914.stderr
Original file line number Diff line number Diff line change
@@ -4,11 +4,6 @@ error[E0308]: mismatched types
LL | t.and_then(|t| -> _ { bar(t) });
| ^^^^^^ expected `Result<_, Error>`, found opaque type
|
note: while checking the return type of the `async fn`
--> $DIR/issue-99914.rs:13:23
|
LL | async fn bar(t: Okay) {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected enum `Result<_, Error>`
found opaque type `impl Future<Output = ()>`
help: try wrapping the expression in `Ok`
15 changes: 3 additions & 12 deletions tests/ui/suggestions/if-then-neeing-semi.rs
Original file line number Diff line number Diff line change
@@ -15,18 +15,9 @@ fn extra_semicolon() {
};
}

async fn async_dummy() {} //~ NOTE checked the `Output` of this `async fn`, found opaque type
//~| NOTE while checking the return type of the `async fn`
//~| NOTE in this expansion of desugaring of `async` block or function
//~| NOTE checked the `Output` of this `async fn`, expected opaque type
//~| NOTE while checking the return type of the `async fn`
//~| NOTE in this expansion of desugaring of `async` block or function
async fn async_dummy2() {} //~ NOTE checked the `Output` of this `async fn`, found opaque type
//~| NOTE checked the `Output` of this `async fn`, found opaque type
//~| NOTE while checking the return type of the `async fn`
//~| NOTE in this expansion of desugaring of `async` block or function
//~| NOTE while checking the return type of the `async fn`
//~| NOTE in this expansion of desugaring of `async` block or function
async fn async_dummy() {}

async fn async_dummy2() {}

async fn async_extra_semicolon_same() {
let _ = if true {
28 changes: 4 additions & 24 deletions tests/ui/suggestions/if-then-neeing-semi.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: `if` and `else` have incompatible types
--> $DIR/if-then-neeing-semi.rs:37:9
--> $DIR/if-then-neeing-semi.rs:28:9
|
LL | let _ = if true {
| _____________-
@@ -15,11 +15,6 @@ LL | |
LL | | };
| |_____- `if` and `else` have incompatible types
|
note: while checking the return type of the `async fn`
--> $DIR/if-then-neeing-semi.rs:18:24
|
LL | async fn async_dummy() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected unit type `()`
found opaque type `impl Future<Output = ()>`
help: consider `await`ing on the `Future`
@@ -33,7 +28,7 @@ LL + async_dummy()
|

error[E0308]: `if` and `else` have incompatible types
--> $DIR/if-then-neeing-semi.rs:50:9
--> $DIR/if-then-neeing-semi.rs:41:9
|
LL | let _ = if true {
| _____________-
@@ -49,11 +44,6 @@ LL | |
LL | | };
| |_____- `if` and `else` have incompatible types
|
note: while checking the return type of the `async fn`
--> $DIR/if-then-neeing-semi.rs:24:25
|
LL | async fn async_dummy2() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected unit type `()`
found opaque type `impl Future<Output = ()>`
help: consider `await`ing on the `Future`
@@ -69,7 +59,7 @@ LL ~ Box::new(async_dummy2())
|

error[E0308]: `if` and `else` have incompatible types
--> $DIR/if-then-neeing-semi.rs:63:9
--> $DIR/if-then-neeing-semi.rs:54:9
|
LL | let _ = if true {
| _____________-
@@ -85,18 +75,8 @@ LL | |
LL | | };
| |_____- `if` and `else` have incompatible types
|
note: while checking the return type of the `async fn`
--> $DIR/if-then-neeing-semi.rs:18:24
|
LL | async fn async_dummy() {}
| ^ checked the `Output` of this `async fn`, expected opaque type
note: while checking the return type of the `async fn`
--> $DIR/if-then-neeing-semi.rs:24:25
|
LL | async fn async_dummy2() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected opaque type `impl Future<Output = ()>` (opaque type at <$DIR/if-then-neeing-semi.rs:18:24>)
found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/if-then-neeing-semi.rs:24:25>)
found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/if-then-neeing-semi.rs:20:25>)
= note: distinct uses of `impl Trait` result in different opaque types
help: consider `await`ing on both `Future`s
|
5 changes: 0 additions & 5 deletions tests/ui/suggestions/issue-81839.stderr
Original file line number Diff line number Diff line change
@@ -14,11 +14,6 @@ LL | | _ => cx.answer_str("hi"),
LL | | }
| |_____- `match` arms have incompatible types
|
note: while checking the return type of the `async fn`
--> $DIR/auxiliary/issue-81839.rs:6:49
|
LL | pub async fn answer_str(&self, _s: &str) -> Test {
| ^^^^ checked the `Output` of this `async fn`, found opaque type
= note: expected unit type `()`
found opaque type `impl Future<Output = Test>`

15 changes: 3 additions & 12 deletions tests/ui/suggestions/match-prev-arm-needing-semi.rs
Original file line number Diff line number Diff line change
@@ -13,18 +13,9 @@ fn extra_semicolon() {
};
}

async fn async_dummy() {} //~ NOTE checked the `Output` of this `async fn`, found opaque type
//~| NOTE while checking the return type of the `async fn`
//~| NOTE in this expansion of desugaring of `async` block or function
//~| NOTE checked the `Output` of this `async fn`, expected opaque type
//~| NOTE while checking the return type of the `async fn`
//~| NOTE in this expansion of desugaring of `async` block or function
async fn async_dummy2() {} //~ NOTE checked the `Output` of this `async fn`, found opaque type
//~| NOTE checked the `Output` of this `async fn`, found opaque type
//~| NOTE while checking the return type of the `async fn`
//~| NOTE in this expansion of desugaring of `async` block or function
//~| NOTE while checking the return type of the `async fn`
//~| NOTE in this expansion of desugaring of `async` block or function
async fn async_dummy() {}

async fn async_dummy2() {}

async fn async_extra_semicolon_same() {
let _ = match true { //~ NOTE `match` arms have incompatible types
28 changes: 4 additions & 24 deletions tests/ui/suggestions/match-prev-arm-needing-semi.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: `match` arms have incompatible types
--> $DIR/match-prev-arm-needing-semi.rs:35:18
--> $DIR/match-prev-arm-needing-semi.rs:26:18
|
LL | let _ = match true {
| _____________-
@@ -15,11 +15,6 @@ LL | |
LL | | };
| |_____- `match` arms have incompatible types
|
note: while checking the return type of the `async fn`
--> $DIR/match-prev-arm-needing-semi.rs:16:24
|
LL | async fn async_dummy() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected unit type `()`
found opaque type `impl Future<Output = ()>`
help: consider `await`ing on the `Future`
@@ -33,7 +28,7 @@ LL + async_dummy()
|

error[E0308]: `match` arms have incompatible types
--> $DIR/match-prev-arm-needing-semi.rs:48:18
--> $DIR/match-prev-arm-needing-semi.rs:39:18
|
LL | let _ = match true {
| _____________-
@@ -49,11 +44,6 @@ LL | |
LL | | };
| |_____- `match` arms have incompatible types
|
note: while checking the return type of the `async fn`
--> $DIR/match-prev-arm-needing-semi.rs:22:25
|
LL | async fn async_dummy2() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected unit type `()`
found opaque type `impl Future<Output = ()>`
help: consider `await`ing on the `Future`
@@ -69,7 +59,7 @@ LL ~ false => Box::new(async_dummy2()),
|

error[E0308]: `match` arms have incompatible types
--> $DIR/match-prev-arm-needing-semi.rs:59:18
--> $DIR/match-prev-arm-needing-semi.rs:50:18
|
LL | let _ = match true {
| _____________-
@@ -83,18 +73,8 @@ LL | |
LL | | };
| |_____- `match` arms have incompatible types
|
note: while checking the return type of the `async fn`
--> $DIR/match-prev-arm-needing-semi.rs:16:24
|
LL | async fn async_dummy() {}
| ^ checked the `Output` of this `async fn`, expected opaque type
note: while checking the return type of the `async fn`
--> $DIR/match-prev-arm-needing-semi.rs:22:25
|
LL | async fn async_dummy2() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected opaque type `impl Future<Output = ()>` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:16:24>)
found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:22:25>)
found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:18:25>)
= note: distinct uses of `impl Trait` result in different opaque types
help: consider `await`ing on both `Future`s
|
5 changes: 0 additions & 5 deletions tests/ui/type-alias-impl-trait/issue-98604.stderr
Original file line number Diff line number Diff line change
@@ -4,11 +4,6 @@ error[E0271]: expected `test` to be a fn item that returns `Pin<Box<dyn Future<O
LL | Box::new(test) as AsyncFnPtr;
| ^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
|
note: while checking the return type of the `async fn`
--> $DIR/issue-98604.rs:5:17
|
LL | async fn test() {}
| ^ checked the `Output` of this `async fn`, found opaque type
= note: expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
found opaque type `impl Future<Output = ()>`
= note: required for the cast from `fn() -> impl Future<Output = ()> {test}` to the object type `dyn Fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>>`