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

ices/82909.rs: fixed with errors #1379

Merged
merged 1 commit into from
Aug 11, 2022
Merged

ices/82909.rs: fixed with errors #1379

merged 1 commit into from
Aug 11, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#82909

struct Sum(u32, u32);
impl PartialEq for Sum {
    fn eq(&self, other: &Self) -> bool {
        0 == 0
    }
}
#[derive(PartialEq)]
enum Eek {
    UnusedByTheConst(Sum),
}
const SUM_THREE: Eek = Eek::UnusedByTheConst(Sum(3, 0));
const EEK_ONE: &[Eek] = &[SUM_THREE];
fn main() {
    match &&&[][..] {
        &&EEK_ONE => {}
    }
}
=== stdout ===
=== stderr ===
warning: to use a constant of type `Eek` in a pattern, `Eek` must be annotated with `#[derive(PartialEq, Eq)]`
  --> /home/runner/work/glacier/glacier/ices/82909.rs:15:11
   |
15 |         &&EEK_ONE => {}
   |           ^^^^^^^
   |
   = note: `#[warn(indirect_structural_match)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>

error[E0004]: non-exhaustive patterns: `&&&_` not covered
  --> /home/runner/work/glacier/glacier/ices/82909.rs:14:11
   |
14 |     match &&&[][..] {
   |           ^^^^^^^^^ pattern `&&&_` not covered
   |
   = note: the matched value is of type `&&&[Eek]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
   |
15 ~         &&EEK_ONE => {}
16 +         &&&_ => todo!()
   |

warning: unused variable: `other`
 --> /home/runner/work/glacier/glacier/ices/82909.rs:3:18
  |
3 |     fn eq(&self, other: &Self) -> bool {
  |                  ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
  |
  = note: `#[warn(unused_variables)]` on by default

error: aborting due to previous error; 2 warnings emitted

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

=== stdout ===
=== stderr ===
warning: to use a constant of type `Eek` in a pattern, `Eek` must be annotated with `#[derive(PartialEq, Eq)]`
  --> /home/runner/work/glacier/glacier/ices/82909.rs:15:11
   |
15 |         &&EEK_ONE => {}
   |           ^^^^^^^
   |
   = note: `#[warn(indirect_structural_match)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #62411 <rust-lang/rust#62411>

error[E0004]: non-exhaustive patterns: `&&&_` not covered
  --> /home/runner/work/glacier/glacier/ices/82909.rs:14:11
   |
14 |     match &&&[][..] {
   |           ^^^^^^^^^ pattern `&&&_` not covered
   |
   = note: the matched value is of type `&&&[Eek]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
   |
15 ~         &&EEK_ONE => {}
16 +         &&&_ => todo!()
   |

warning: unused variable: `other`
 --> /home/runner/work/glacier/glacier/ices/82909.rs:3:18
  |
3 |     fn eq(&self, other: &Self) -> bool {
  |                  ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`
  |
  = note: `#[warn(unused_variables)]` on by default

error: aborting due to previous error; 2 warnings emitted

For more information about this error, try `rustc --explain E0004`.
==============
@JohnTitor JohnTitor merged commit ea68f2f into master Aug 11, 2022
@JohnTitor JohnTitor deleted the autofix/ices/82909.rs branch August 11, 2022 04:01
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