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

ices/92074.rs: fixed with errors #1075

Merged
merged 1 commit into from
Jan 4, 2022
Merged

ices/92074.rs: fixed with errors #1075

merged 1 commit into from
Jan 4, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 4, 2022

Issue: rust-lang/rust#92074

pub enum En {
    A(Vec<u8>)
}

fn f() -> Result<(), impl core::fmt::Debug> {
    let x: En = loop {};

    assert!(matches!(x, En::A(vec![])));
    Ok::<(), &'static str>(())
}
=== stdout ===
=== stderr ===
error: arbitrary expressions aren't allowed in patterns
 --> /home/runner/work/glacier/glacier/ices/92074.rs:8:31
  |
8 |     assert!(matches!(x, En::A(vec![])));
  |                               ^^^^^^
  |
  = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0601]: `main` function not found in crate `92074`
  --> /home/runner/work/glacier/glacier/ices/92074.rs:1:1
   |
1  | / pub enum En {
2  | |     A(Vec<u8>)
3  | | }
4  | |
...  |
9  | |     Ok::<(), &'static str>(())
10 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/92074.rs`

warning: unreachable statement
 --> /home/runner/work/glacier/glacier/ices/92074.rs:8:5
  |
6 |     let x: En = loop {};
  |                 ------- any code following this expression is unreachable
7 | 
8 |     assert!(matches!(x, En::A(vec![])));
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
  |
  = note: `#[warn(unreachable_code)]` on by default
  = note: this warning originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0601`.
==============

=== stdout ===
=== stderr ===
error: arbitrary expressions aren't allowed in patterns
 --> /home/runner/work/glacier/glacier/ices/92074.rs:8:31
  |
8 |     assert!(matches!(x, En::A(vec![])));
  |                               ^^^^^^
  |
  = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0601]: `main` function not found in crate `92074`
  --> /home/runner/work/glacier/glacier/ices/92074.rs:1:1
   |
1  | / pub enum En {
2  | |     A(Vec<u8>)
3  | | }
4  | |
...  |
9  | |     Ok::<(), &'static str>(())
10 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/92074.rs`

warning: unreachable statement
 --> /home/runner/work/glacier/glacier/ices/92074.rs:8:5
  |
6 |     let x: En = loop {};
  |                 ------- any code following this expression is unreachable
7 | 
8 |     assert!(matches!(x, En::A(vec![])));
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
  |
  = note: `#[warn(unreachable_code)]` on by default
  = note: this warning originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0601`.
==============
@Alexendoo Alexendoo merged commit 243ed70 into master Jan 4, 2022
@Alexendoo Alexendoo deleted the autofix/ices/92074.rs branch January 4, 2022 12:24
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.

None yet

2 participants