diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/async-await/unnecessary-await.rs | 5 | ||||
| -rw-r--r-- | tests/ui/async-await/unnecessary-await.stderr | 15 | ||||
| -rw-r--r-- | tests/ui/invalid-compile-flags/invalid-llvm-passes.rs (renamed from tests/ui/invalid/invalid-llvm-passes.rs) | 0 | ||||
| -rw-r--r-- | tests/ui/invalid-compile-flags/invalid-llvm-passes.stderr (renamed from tests/ui/invalid/invalid-llvm-passes.stderr) | 0 | ||||
| -rw-r--r-- | tests/ui/suggestions/issue-81839.stderr | 15 | ||||
| -rw-r--r-- | tests/ui/wf/wf-unsafe-trait-obj-match.stderr | 4 |
6 files changed, 34 insertions, 5 deletions
diff --git a/tests/ui/async-await/unnecessary-await.rs b/tests/ui/async-await/unnecessary-await.rs index cd1e2871432..93b68f018e4 100644 --- a/tests/ui/async-await/unnecessary-await.rs +++ b/tests/ui/async-await/unnecessary-await.rs @@ -31,4 +31,9 @@ async fn with_macros() { f!(()); } +// Regression test for issue #117014. +async fn desugaring_span_ctxt() { + for x in [] {}.await //~ ERROR `()` is not a future +} + fn main() {} diff --git a/tests/ui/async-await/unnecessary-await.stderr b/tests/ui/async-await/unnecessary-await.stderr index 9a2a035b2dd..620370a6113 100644 --- a/tests/ui/async-await/unnecessary-await.stderr +++ b/tests/ui/async-await/unnecessary-await.stderr @@ -49,6 +49,19 @@ LL | f!(()); = note: required for `()` to implement `IntoFuture` = note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 3 previous errors +error[E0277]: `()` is not a future + --> $DIR/unnecessary-await.rs:36:20 + | +LL | for x in [] {}.await + | -^^^^^ + | || + | |`()` is not a future + | help: remove the `.await` + | + = help: the trait `Future` is not implemented for `()` + = note: () must be a future or must implement `IntoFuture` to be awaited + = note: required for `()` to implement `IntoFuture` + +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/invalid/invalid-llvm-passes.rs b/tests/ui/invalid-compile-flags/invalid-llvm-passes.rs index ee28f5eb6d6..ee28f5eb6d6 100644 --- a/tests/ui/invalid/invalid-llvm-passes.rs +++ b/tests/ui/invalid-compile-flags/invalid-llvm-passes.rs diff --git a/tests/ui/invalid/invalid-llvm-passes.stderr b/tests/ui/invalid-compile-flags/invalid-llvm-passes.stderr index ae1f85e41e4..ae1f85e41e4 100644 --- a/tests/ui/invalid/invalid-llvm-passes.stderr +++ b/tests/ui/invalid-compile-flags/invalid-llvm-passes.stderr diff --git a/tests/ui/suggestions/issue-81839.stderr b/tests/ui/suggestions/issue-81839.stderr index 6d0a0c7b3fa..238ee637c7d 100644 --- a/tests/ui/suggestions/issue-81839.stderr +++ b/tests/ui/suggestions/issue-81839.stderr @@ -4,15 +4,22 @@ error[E0308]: `match` arms have incompatible types LL | / match num { LL | | 1 => { LL | | cx.answer_str("hi"); - | | -------------------- - | | | | - | | | help: consider removing this semicolon - | | this is found to be of type `()` + | | -------------------- this is found to be of type `()` LL | | } LL | | _ => cx.answer_str("hi"), | | ^^^^^^^^^^^^^^^^^^^ expected `()`, found future LL | | } | |_____- `match` arms have incompatible types + | +help: consider removing this semicolon + | +LL - cx.answer_str("hi"); +LL + cx.answer_str("hi") + | +help: consider using a semicolon here, but this will discard any values in the match arms + | +LL | }; + | + error: aborting due to previous error diff --git a/tests/ui/wf/wf-unsafe-trait-obj-match.stderr b/tests/ui/wf/wf-unsafe-trait-obj-match.stderr index 66504e44060..d5b23572ff5 100644 --- a/tests/ui/wf/wf-unsafe-trait-obj-match.stderr +++ b/tests/ui/wf/wf-unsafe-trait-obj-match.stderr @@ -11,6 +11,10 @@ LL | | } | = note: expected reference `&S` found reference `&R` +help: consider using a semicolon here, but this will discard any values in the match arms + | +LL | }; + | + error[E0038]: the trait `Trait` cannot be made into an object --> $DIR/wf-unsafe-trait-obj-match.rs:26:21 |
