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

ices/65466.rs: fixed with no errors #472

Merged
merged 1 commit into from
Sep 27, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#65466

#![deny(indirect_structural_match)]

#[derive(PartialEq, Eq)]
enum O<T> {
    Some(*const T), // Can also use PhantomData<T>
    None,
}

struct B;

const C: &[O<B>] = &[O::None];

pub fn foo() {
    let x = O::None;
    match &[x][..] {
        C => (),
        _ => (),
    }
}

fn main() {}
=== stdout ===
=== stderr ===
warning: variant is never constructed: `Some`
 --> /home/runner/work/glacier/glacier/ices/65466.rs:5:5
  |
5 |     Some(*const T), // Can also use PhantomData<T>
  |     ^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: variant is never constructed: `Some`
 --> /home/runner/work/glacier/glacier/ices/65466.rs:5:5
  |
5 |     Some(*const T), // Can also use PhantomData<T>
  |     ^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: 1 warning emitted

==============
@Alexendoo Alexendoo merged commit b03ae52 into master Sep 27, 2020
@Alexendoo Alexendoo deleted the autofix/ices/65466.rs branch September 27, 2020 17:27
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