diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-06 13:27:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-06 13:27:44 +0100 |
| commit | e29a510ff0484d157e1aac200e1fde84e9b5b144 (patch) | |
| tree | 14a301d4361ae7a9c057ba608eff7c9eb8e2cb5e /src/test | |
| parent | 61189b6ae3c5ccc8a38be18aad7ef75c253d7c28 (diff) | |
| parent | da929fa63c7a9687de708587f170cbe7f874a495 (diff) | |
| download | rust-e29a510ff0484d157e1aac200e1fde84e9b5b144.tar.gz rust-e29a510ff0484d157e1aac200e1fde84e9b5b144.zip | |
Rollup merge of #105318 - compiler-errors:issue-105304, r=jackh726
Make `get_impl_future_output_ty` work with AFIT Fixes #105304
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/async-await/in-trait/return-type-suggestion.rs | 14 | ||||
| -rw-r--r-- | src/test/ui/async-await/in-trait/return-type-suggestion.stderr | 23 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/test/ui/async-await/in-trait/return-type-suggestion.rs b/src/test/ui/async-await/in-trait/return-type-suggestion.rs new file mode 100644 index 00000000000..3446761d119 --- /dev/null +++ b/src/test/ui/async-await/in-trait/return-type-suggestion.rs @@ -0,0 +1,14 @@ +// edition: 2021 + +#![feature(async_fn_in_trait)] +//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes + +trait A { + async fn e() { + Ok(()) + //~^ ERROR mismatched types + //~| HELP consider using a semicolon here + } +} + +fn main() {} diff --git a/src/test/ui/async-await/in-trait/return-type-suggestion.stderr b/src/test/ui/async-await/in-trait/return-type-suggestion.stderr new file mode 100644 index 00000000000..5a9b15e54a0 --- /dev/null +++ b/src/test/ui/async-await/in-trait/return-type-suggestion.stderr @@ -0,0 +1,23 @@ +warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/return-type-suggestion.rs:3:12 + | +LL | #![feature(async_fn_in_trait)] + | ^^^^^^^^^^^^^^^^^ + | + = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information + = note: `#[warn(incomplete_features)]` on by default + +error[E0308]: mismatched types + --> $DIR/return-type-suggestion.rs:8:9 + | +LL | Ok(()) + | ^^^^^^- help: consider using a semicolon here: `;` + | | + | expected `()`, found enum `Result` + | + = note: expected unit type `()` + found enum `Result<(), _>` + +error: aborting due to previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0308`. |
