Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

ices/84841.rs: fixed with errors #859

Merged
merged 1 commit into from
Jul 5, 2021
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jul 5, 2021

Issue: rust-lang/rust#84841

async fn main() {
    // Adding an .await here avoids the ICE
    test()?;
}

// Removing the const generic parameter here avoids the ICE
async fn test<const N: usize>() {
}
=== stdout ===
=== stderr ===
error[E0277]: the `?` operator can only be applied to values that implement `Try`
 --> /home/runner/work/glacier/glacier/ices/84841.rs:3:5
  |
3 |     test()?;
  |     ^^^^^^^ the `?` operator cannot be applied to type `impl Future`
  |
  = help: the trait `Try` is not implemented for `impl Future`
  = note: required by `branch`

error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
 --> /home/runner/work/glacier/glacier/ices/84841.rs:3:11
  |
1 |   async fn main() {
  |  _________________-
2 | |     // Adding an .await here avoids the ICE
3 | |     test()?;
  | |           ^ cannot use the `?` operator in an async function that returns `()`
4 | | }
  | |_- this function should return `Result` or `Option` to accept `?`
  |
  = help: the trait `FromResidual<_>` is not implemented for `()`
  = note: required by `from_residual`

error[E0752]: `main` function is not allowed to be `async`
 --> /home/runner/work/glacier/glacier/ices/84841.rs:1:1
  |
1 | async fn main() {
  | ^^^^^^^^^^^^^^^ `main` function is not allowed to be `async`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0277, E0752.
For more information about an error, try `rustc --explain E0277`.
==============

=== stdout ===
=== stderr ===
error[E0277]: the `?` operator can only be applied to values that implement `Try`
 --> /home/runner/work/glacier/glacier/ices/84841.rs:3:5
  |
3 |     test()?;
  |     ^^^^^^^ the `?` operator cannot be applied to type `impl Future`
  |
  = help: the trait `Try` is not implemented for `impl Future`
  = note: required by `branch`

error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
 --> /home/runner/work/glacier/glacier/ices/84841.rs:3:11
  |
1 |   async fn main() {
  |  _________________-
2 | |     // Adding an .await here avoids the ICE
3 | |     test()?;
  | |           ^ cannot use the `?` operator in an async function that returns `()`
4 | | }
  | |_- this function should return `Result` or `Option` to accept `?`
  |
  = help: the trait `FromResidual<_>` is not implemented for `()`
  = note: required by `from_residual`

error[E0752]: `main` function is not allowed to be `async`
 --> /home/runner/work/glacier/glacier/ices/84841.rs:1:1
  |
1 | async fn main() {
  | ^^^^^^^^^^^^^^^ `main` function is not allowed to be `async`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0277, E0752.
For more information about an error, try `rustc --explain E0277`.
==============
@Alexendoo Alexendoo merged commit 01786b9 into master Jul 5, 2021
@Alexendoo Alexendoo deleted the autofix/ices/84841.rs branch July 5, 2021 15:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants