diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
commit | 2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch) | |
tree | d325add32978dbdc1db975a438b3a77d571b1ab8 /tests/ui/async-await/issues | |
parent | Releasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
13 files changed, 124 insertions, 26 deletions
diff --git a/tests/ui/async-await/issues/auxiliary/issue_67893.rs b/tests/ui/async-await/issues/auxiliary/issue_67893.rs index 387966a50..d53944698 100644 --- a/tests/ui/async-await/issues/auxiliary/issue_67893.rs +++ b/tests/ui/async-await/issues/auxiliary/issue_67893.rs @@ -1,3 +1,6 @@ +// revisions: no_drop_tracking drop_tracking drop_tracking_mir +// [drop_tracking] compile-flags: -Zdrop-tracking +// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 use std::sync::{Arc, Mutex}; diff --git a/tests/ui/async-await/issues/issue-102206.stderr b/tests/ui/async-await/issues/issue-102206.stderr index 2ab790ac7..750b7a886 100644 --- a/tests/ui/async-await/issues/issue-102206.stderr +++ b/tests/ui/async-await/issues/issue-102206.stderr @@ -4,17 +4,10 @@ error[E0308]: mismatched types LL | std::mem::size_of_val(foo()); | --------------------- ^^^^^ | | | - | | expected reference, found opaque type + | | expected `&_`, found future | | 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 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL diff --git a/tests/ui/async-await/issues/issue-107280.rs b/tests/ui/async-await/issues/issue-107280.rs new file mode 100644 index 000000000..85fce8740 --- /dev/null +++ b/tests/ui/async-await/issues/issue-107280.rs @@ -0,0 +1,15 @@ +// edition:2021 + +async fn foo() { + inner::<false>().await + //~^ ERROR: function takes 2 generic arguments but 1 generic argument was supplied + //~| ERROR: type inside `async fn` body must be known in this context + //~| ERROR: type inside `async fn` body must be known in this context + //~| ERROR: type inside `async fn` body must be known in this context + //~| ERROR: type inside `async fn` body must be known in this context + //~| ERROR: type inside `async fn` body must be known in this context +} + +async fn inner<T, const PING: bool>() {} + +fn main() {} diff --git a/tests/ui/async-await/issues/issue-107280.stderr b/tests/ui/async-await/issues/issue-107280.stderr new file mode 100644 index 000000000..dd3e10fcc --- /dev/null +++ b/tests/ui/async-await/issues/issue-107280.stderr @@ -0,0 +1,82 @@ +error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied + --> $DIR/issue-107280.rs:4:5 + | +LL | inner::<false>().await + | ^^^^^ ----- supplied 1 generic argument + | | + | expected 2 generic arguments + | +note: function defined here, with 2 generic parameters: `T`, `PING` + --> $DIR/issue-107280.rs:13:10 + | +LL | async fn inner<T, const PING: bool>() {} + | ^^^^^ - ---------------- +help: add missing generic argument + | +LL | inner::<false, PING>().await + | ++++++ + +error[E0698]: type inside `async fn` body must be known in this context + --> $DIR/issue-107280.rs:4:5 + | +LL | inner::<false>().await + | ^^^^^^^^^^^^^^ cannot infer the value of const parameter `PING` declared on the function `inner` + | +note: the type is part of the `async fn` body because of this `await` + --> $DIR/issue-107280.rs:4:21 + | +LL | inner::<false>().await + | ^^^^^^ + +error[E0698]: type inside `async fn` body must be known in this context + --> $DIR/issue-107280.rs:4:5 + | +LL | inner::<false>().await + | ^^^^^^^^^^^^^^ cannot infer the value of const parameter `PING` declared on the function `inner` + | +note: the type is part of the `async fn` body because of this `await` + --> $DIR/issue-107280.rs:4:21 + | +LL | inner::<false>().await + | ^^^^^^ + +error[E0698]: type inside `async fn` body must be known in this context + --> $DIR/issue-107280.rs:4:5 + | +LL | inner::<false>().await + | ^^^^^^^^^^^^^^ cannot infer the value of const parameter `PING` declared on the function `inner` + | +note: the type is part of the `async fn` body because of this `await` + --> $DIR/issue-107280.rs:4:21 + | +LL | inner::<false>().await + | ^^^^^^ + +error[E0698]: type inside `async fn` body must be known in this context + --> $DIR/issue-107280.rs:4:5 + | +LL | inner::<false>().await + | ^^^^^^^^^^^^^^ cannot infer the value of const parameter `PING` declared on the function `inner` + | +note: the type is part of the `async fn` body because of this `await` + --> $DIR/issue-107280.rs:4:21 + | +LL | inner::<false>().await + | ^^^^^^ + +error[E0698]: type inside `async fn` body must be known in this context + --> $DIR/issue-107280.rs:4:5 + | +LL | inner::<false>().await + | ^^^^^^^^^^^^^^ cannot infer the value of const parameter `PING` declared on the function `inner` + | +note: the type is part of the `async fn` body because of this `await` + --> $DIR/issue-107280.rs:4:21 + | +LL | inner::<false>().await + | ^^^^^^ + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0107, E0698. +For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/async-await/issues/issue-62097.rs b/tests/ui/async-await/issues/issue-62097.rs index a24c84cff..13c72abb1 100644 --- a/tests/ui/async-await/issues/issue-62097.rs +++ b/tests/ui/async-await/issues/issue-62097.rs @@ -12,7 +12,7 @@ impl Struct { pub async fn run_dummy_fn(&self) { foo(|| self.bar()).await; //~^ ERROR closure may outlive the current function - //~| ERROR borrowed data escapes outside of associated function + //~| ERROR borrowed data escapes outside of method } pub fn bar(&self) {} diff --git a/tests/ui/async-await/issues/issue-62097.stderr b/tests/ui/async-await/issues/issue-62097.stderr index 786f62132..21a61548d 100644 --- a/tests/ui/async-await/issues/issue-62097.stderr +++ b/tests/ui/async-await/issues/issue-62097.stderr @@ -16,18 +16,18 @@ help: to force the closure to take ownership of `self` (and any other referenced LL | foo(move || self.bar()).await; | ++++ -error[E0521]: borrowed data escapes outside of associated function +error[E0521]: borrowed data escapes outside of method --> $DIR/issue-62097.rs:13:9 | LL | pub async fn run_dummy_fn(&self) { | ----- | | - | `self` is a reference that is only valid in the associated function body + | `self` is a reference that is only valid in the method body | let's call the lifetime of this reference `'1` LL | foo(|| self.bar()).await; | ^^^^^^^^^^^^^^^^^^ | | - | `self` escapes the associated function body here + | `self` escapes the method body here | argument requires that `'1` must outlive `'static` error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/issues/issue-65159.rs b/tests/ui/async-await/issues/issue-65159.rs index df2ca0257..6e547508b 100644 --- a/tests/ui/async-await/issues/issue-65159.rs +++ b/tests/ui/async-await/issues/issue-65159.rs @@ -3,7 +3,7 @@ // edition:2018 async fn copy() -> Result<()> -//~^ ERROR this enum takes 2 generic arguments +//~^ ERROR enum takes 2 generic arguments { Ok(()) } diff --git a/tests/ui/async-await/issues/issue-65159.stderr b/tests/ui/async-await/issues/issue-65159.stderr index 40c0e72b2..b8741333c 100644 --- a/tests/ui/async-await/issues/issue-65159.stderr +++ b/tests/ui/async-await/issues/issue-65159.stderr @@ -1,4 +1,4 @@ -error[E0107]: this enum takes 2 generic arguments but 1 generic argument was supplied +error[E0107]: enum takes 2 generic arguments but 1 generic argument was supplied --> $DIR/issue-65159.rs:5:20 | LL | async fn copy() -> Result<()> diff --git a/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr b/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr index 1033fa6cc..8745bdd97 100644 --- a/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr +++ b/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr @@ -1,5 +1,5 @@ error: future cannot be sent between threads safely - --> $DIR/issue-65436-raw-ptr-not-send.rs:16:17 + --> $DIR/issue-65436-raw-ptr-not-send.rs:17:17 | LL | assert_send(async { | _________________^ @@ -8,9 +8,9 @@ LL | | bar(Foo(std::ptr::null())).await; LL | | }) | |_____^ future created by async block is not `Send` | - = help: within `[async block@$DIR/issue-65436-raw-ptr-not-send.rs:16:17: 19:6]`, the trait `Send` is not implemented for `*const u8` + = help: within `[async block@$DIR/issue-65436-raw-ptr-not-send.rs:17:17: 20:6]`, the trait `Send` is not implemented for `*const u8` note: future is not `Send` as this value is used across an await - --> $DIR/issue-65436-raw-ptr-not-send.rs:18:35 + --> $DIR/issue-65436-raw-ptr-not-send.rs:19:35 | LL | bar(Foo(std::ptr::null())).await; | ---------------- ^^^^^^- `std::ptr::null()` is later dropped here @@ -18,12 +18,12 @@ LL | bar(Foo(std::ptr::null())).await; | | await occurs here, with `std::ptr::null()` maybe used later | has type `*const u8` which is not `Send` help: consider moving this into a `let` binding to create a shorter lived borrow - --> $DIR/issue-65436-raw-ptr-not-send.rs:18:13 + --> $DIR/issue-65436-raw-ptr-not-send.rs:19:13 | LL | bar(Foo(std::ptr::null())).await; | ^^^^^^^^^^^^^^^^^^^^^ note: required by a bound in `assert_send` - --> $DIR/issue-65436-raw-ptr-not-send.rs:13:19 + --> $DIR/issue-65436-raw-ptr-not-send.rs:14:19 | LL | fn assert_send<T: Send>(_: T) {} | ^^^^ required by this bound in `assert_send` diff --git a/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs b/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs index 91edbc10d..d7ef92951 100644 --- a/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs +++ b/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs @@ -1,8 +1,9 @@ // edition:2018 -// revisions: no_drop_tracking drop_tracking +// revisions: no_drop_tracking drop_tracking drop_tracking_mir +// [drop_tracking] compile-flags: -Zdrop-tracking +// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // [drop_tracking] check-pass -// [drop_tracking] compile-flags: -Zdrop-tracking=yes -// [no_drop_tracking] compile-flags: -Zdrop-tracking=no +// [drop_tracking_mir] check-pass struct Foo(*const u8); diff --git a/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs b/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs index dda4a151d..c4f8f607d 100644 --- a/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs +++ b/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs @@ -1,6 +1,10 @@ // build-pass // edition:2018 +// revisions: no_drop_tracking drop_tracking drop_tracking_mir +// [drop_tracking] compile-flags: -Zdrop-tracking +// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir + static mut A: [i32; 5] = [1, 2, 3, 4, 5]; fn is_send_sync<T: Send + Sync>(_: T) {} diff --git a/tests/ui/async-await/issues/issue-67893.stderr b/tests/ui/async-await/issues/issue-67893.stderr index 2ce68a782..ce9424c8b 100644 --- a/tests/ui/async-await/issues/issue-67893.stderr +++ b/tests/ui/async-await/issues/issue-67893.stderr @@ -6,7 +6,7 @@ LL | g(issue_67893::run()) | = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` note: future is not `Send` as this value is used across an await - --> $DIR/auxiliary/issue_67893.rs:9:26 + --> $DIR/auxiliary/issue_67893.rs:12:26 | LL | f(*x.lock().unwrap()).await; | ----------------- ^^^^^^- `x.lock().unwrap()` is later dropped here diff --git a/tests/ui/async-await/issues/issue-72312.stderr b/tests/ui/async-await/issues/issue-72312.stderr index aa947b690..679272858 100644 --- a/tests/ui/async-await/issues/issue-72312.stderr +++ b/tests/ui/async-await/issues/issue-72312.stderr @@ -1,10 +1,10 @@ -error[E0521]: borrowed data escapes outside of associated function +error[E0521]: borrowed data escapes outside of method --> $DIR/issue-72312.rs:12:9 | LL | pub async fn start(&self) { | ----- | | - | `self` is a reference that is only valid in the associated function body + | `self` is a reference that is only valid in the method body | let's call the lifetime of this reference `'1` ... LL | / require_static(async move { @@ -15,7 +15,7 @@ LL | | &self; LL | | }); | | ^ | | | - | |__________`self` escapes the associated function body here + | |__________`self` escapes the method body here | argument requires that `'1` must outlive `'static` error: aborting due to previous error |