Rollup merge of #122732 - compiler-errors:coroutine-captures-note, r=nnethercote

Remove redundant coroutine captures note

This note is redundant, since we'll always be printing this "captures the following types..." between *more* descriptive `BuiltinDerivedObligationCause`s.

Please review with whitespace disabled, since I also removed an unnecessary labeled break.
This commit is contained in:
Matthias Krüger 2024-03-20 05:51:23 +01:00 committed by GitHub
commit ffdb147aa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 61 additions and 73 deletions

View file

@ -38,7 +38,6 @@ LL | async fn bar2<T>(_: T) -> ! {
LL | | panic!()
LL | | }
| |_^
= note: required because it captures the following types: `impl Future<Output = !>`
note: required because it's used within this `async` fn body
--> $DIR/async-await-let-else.rs:18:32
|

View file

@ -58,7 +58,6 @@ note: required because it appears within the type `impl Future<Output = Arc<RefC
|
LL | fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: required because it captures the following types: `impl Future<Output = Arc<RefCell<i32>>>`, `Ready<i32>`
note: required because it's used within this `async` block
--> $DIR/issue-68112.rs:57:20
|

View file

@ -25,7 +25,6 @@ LL | async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
| ___________________________________________________________________^
LL | | }
| |_^
= note: required because it captures the following types: `impl Future<Output = ()>`
note: required because it's used within this `async` block
--> $DIR/issue-70935-complex-spans.rs:18:5
|
@ -63,7 +62,6 @@ LL | async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
| ___________________________________________________________________^
LL | | }
| |_^
= note: required because it captures the following types: `impl Future<Output = ()>`
note: required because it's used within this `async` block
--> $DIR/issue-70935-complex-spans.rs:18:5
|

View file

@ -12,7 +12,6 @@ LL | pub async fn run() {
| ------------------ within this `impl Future<Output = ()>`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`, which is required by `impl Future<Output = ()>: Send`
= note: required because it captures the following types: `Arc<Mutex<()>>`, `MutexGuard<'_, ()>`, `impl Future<Output = ()>`
note: required because it's used within this `async` fn body
--> $DIR/auxiliary/issue_67893.rs:9:20
|

View file

@ -8,7 +8,6 @@ fn main() {
//~| NOTE cannot be sent
//~| NOTE bound introduced by
//~| NOTE appears within the type
//~| NOTE captures the following types
}
fn gimme_send<T: Send>(t: T) {

View file

@ -11,9 +11,8 @@ LL | async fn foo() {
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `NotSend`, which is required by `impl Future<Output = ()>: Send`
= note: required because it appears within the type `(NotSend,)`
= note: required because it captures the following types: `(NotSend,)`, `impl Future<Output = ()>`
note: required because it's used within this `async` fn body
--> $DIR/partial-drop-partial-reinit.rs:28:16
--> $DIR/partial-drop-partial-reinit.rs:27:16
|
LL | async fn foo() {
| ________________^
@ -25,7 +24,7 @@ LL | | bar().await;
LL | | }
| |_^
note: required by a bound in `gimme_send`
--> $DIR/partial-drop-partial-reinit.rs:14:18
--> $DIR/partial-drop-partial-reinit.rs:13:18
|
LL | fn gimme_send<T: Send>(t: T) {
| ^^^^ required by this bound in `gimme_send`

View file

@ -65,7 +65,6 @@ fn test2() {
//~^ ERROR `RefCell<i32>` cannot be shared between threads safely
//~| NOTE `RefCell<i32>` cannot be shared between threads safely
//~| NOTE required for
//~| NOTE captures the following types
//~| NOTE use `std::sync::RwLock` instead
}

View file

@ -44,7 +44,6 @@ note: required because it appears within the type `impl Coroutine<Return = Arc<R
|
LL | fn make_non_send_coroutine2() -> impl Coroutine<Return = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: required because it captures the following types: `impl Coroutine<Return = Arc<RefCell<i32>>>`
note: required because it's used within this coroutine
--> $DIR/issue-68112.rs:60:20
|

View file

@ -43,7 +43,6 @@ note: required because it appears within the type `Opaque(DefId(0:36 ~ coroutine
|
LL | fn make_non_send_coroutine2() -> impl Coroutine<Return = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: required because it captures the following types: `Opaque(DefId(0:36 ~ coroutine_print_verbose_1[75fb]::make_non_send_coroutine2::{opaque#0}), [])`
note: required because it's used within this coroutine
--> $DIR/coroutine-print-verbose-1.rs:52:20
|