mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
6efddac288
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
67 lines
1.9 KiB
Plaintext
67 lines
1.9 KiB
Plaintext
error[E0277]: `()` is not a future
|
|
--> $DIR/issue-96555.rs:4:13
|
|
|
|
|
LL | m::f1().await;
|
|
| ------- ^^^^^ `()` is not a future
|
|
| |
|
|
| this call returns `()`
|
|
|
|
|
= help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture`
|
|
= note: () must be a future or must implement `IntoFuture` to be awaited
|
|
= note: required for `()` to implement `IntoFuture`
|
|
help: remove the `.await`
|
|
|
|
|
LL - m::f1().await;
|
|
LL + m::f1();
|
|
|
|
|
help: alternatively, consider making `fn f1` asynchronous
|
|
|
|
|
LL | pub async fn f1() {}
|
|
| +++++
|
|
|
|
error[E0277]: `()` is not a future
|
|
--> $DIR/issue-96555.rs:5:13
|
|
|
|
|
LL | m::f2().await;
|
|
| ------- ^^^^^ `()` is not a future
|
|
| |
|
|
| this call returns `()`
|
|
|
|
|
= help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture`
|
|
= note: () must be a future or must implement `IntoFuture` to be awaited
|
|
= note: required for `()` to implement `IntoFuture`
|
|
help: remove the `.await`
|
|
|
|
|
LL - m::f2().await;
|
|
LL + m::f2();
|
|
|
|
|
help: alternatively, consider making `fn f2` asynchronous
|
|
|
|
|
LL | pub(crate) async fn f2() {}
|
|
| +++++
|
|
|
|
error[E0277]: `()` is not a future
|
|
--> $DIR/issue-96555.rs:6:13
|
|
|
|
|
LL | m::f3().await;
|
|
| ------- ^^^^^ `()` is not a future
|
|
| |
|
|
| this call returns `()`
|
|
|
|
|
= help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture`
|
|
= note: () must be a future or must implement `IntoFuture` to be awaited
|
|
= note: required for `()` to implement `IntoFuture`
|
|
help: remove the `.await`
|
|
|
|
|
LL - m::f3().await;
|
|
LL + m::f3();
|
|
|
|
|
help: alternatively, consider making `fn f3` asynchronous
|
|
|
|
|
LL | pub async
|
|
| +++++
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|