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

ices/100771.sh: fixed with no errors #1400

Merged
merged 1 commit into from
Aug 24, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#100771

#!/bin/bash

rustc  -Zextra-const-ub-checks - <<'EOF'

#[derive(PartialEq, Eq, Copy, Clone)]
#[repr(packed)]
struct Foo {
    field: (i64, u32, u32, u32),
}

const FOO: Foo = Foo {
    field: (5, 6, 7, 8),
};

fn main() {
    match FOO {
        Foo { field: (5, 6, 7, 8) } => {},
        FOO => unreachable!(), //~ WARNING unreachable pattern
        _ => unreachable!(),
    }
}

EOF

=== stdout ===
=== stderr ===
warning: unreachable pattern
  --> <anon>:15:9
   |
15 |         FOO => unreachable!(), //~ WARNING unreachable pattern
   |         ^^^
   |
   = note: `#[warn(unreachable_patterns)]` on by default

warning: 1 warning emitted

==============

=== stdout ===
=== stderr ===
warning: unreachable pattern
  --> <anon>:15:9
   |
15 |         FOO => unreachable!(), //~ WARNING unreachable pattern
   |         ^^^
   |
   = note: `#[warn(unreachable_patterns)]` on by default

warning: 1 warning emitted

==============
@Alexendoo Alexendoo merged commit 735eecb into master Aug 24, 2022
@Alexendoo Alexendoo deleted the autofix/ices/100771.sh branch August 24, 2022 12:10
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