diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-02-12 06:07:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-12 06:07:40 +0100 |
| commit | 77a1d6b266fa6254d65fc7cc2a4401bf6426290f (patch) | |
| tree | 93ae28a6080b626c1bb313ff492d200d83bc05c0 /tests | |
| parent | 86ebf42801c1fe61f4fcece96dc228eff605b8ea (diff) | |
| parent | 6ffe6dd826d737daf363c1251621b7da362a437d (diff) | |
Rollup merge of #136891 - compiler-errors:unconstrained-anon-lt, r=lqd
Check sig for errors before checking for unconstrained anonymous lifetime Fixes #136841
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/async-await/unconstrained-lifetimes.rs | 9 | ||||
| -rw-r--r-- | tests/ui/async-await/unconstrained-lifetimes.stderr | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/async-await/unconstrained-lifetimes.rs b/tests/ui/async-await/unconstrained-lifetimes.rs new file mode 100644 index 00000000000..50ab7bae73d --- /dev/null +++ b/tests/ui/async-await/unconstrained-lifetimes.rs @@ -0,0 +1,9 @@ +//@ edition: 2021 + +// Make sure we don't complain about the implicit `-> impl Future` capturing an +// unconstrained anonymous lifetime. + +async fn foo(_: Missing<'_>) {} +//~^ ERROR cannot find type `Missing` in this scope + +fn main() {} diff --git a/tests/ui/async-await/unconstrained-lifetimes.stderr b/tests/ui/async-await/unconstrained-lifetimes.stderr new file mode 100644 index 00000000000..18a46a3b555 --- /dev/null +++ b/tests/ui/async-await/unconstrained-lifetimes.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `Missing` in this scope + --> $DIR/unconstrained-lifetimes.rs:6:17 + | +LL | async fn foo(_: Missing<'_>) {} + | ^^^^^^^ not found in this scope + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0412`. |
