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

ices/80531.rs: fixed with no errors #605

Merged
merged 1 commit into from
Jan 2, 2021
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 2, 2021

Issue: rust-lang/rust#80531

#![crate_type = "lib"]

enum ConstGenericEnum<const N: usize> {
    Foo([i32; N]),
    Bar,
}

fn foo<const N: usize>(val: &ConstGenericEnum<N>) {
    if let ConstGenericEnum::<N>::Foo(field, ..) = val {
        todo!()
    } else {
        todo!()
    }
}
=== stdout ===
=== stderr ===
warning: unused variable: `field`
 --> /home/runner/work/glacier/glacier/ices/80531.rs:9:39
  |
9 |     if let ConstGenericEnum::<N>::Foo(field, ..) = val {
  |                                       ^^^^^ help: if this is intentional, prefix it with an underscore: `_field`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: enum is never used: `ConstGenericEnum`
 --> /home/runner/work/glacier/glacier/ices/80531.rs:3:6
  |
3 | enum ConstGenericEnum<const N: usize> {
  |      ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `foo`
 --> /home/runner/work/glacier/glacier/ices/80531.rs:8:4
  |
8 | fn foo<const N: usize>(val: &ConstGenericEnum<N>) {
  |    ^^^

warning: 3 warnings emitted

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

=== stdout ===
=== stderr ===
warning: unused variable: `field`
 --> /home/runner/work/glacier/glacier/ices/80531.rs:9:39
  |
9 |     if let ConstGenericEnum::<N>::Foo(field, ..) = val {
  |                                       ^^^^^ help: if this is intentional, prefix it with an underscore: `_field`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: enum is never used: `ConstGenericEnum`
 --> /home/runner/work/glacier/glacier/ices/80531.rs:3:6
  |
3 | enum ConstGenericEnum<const N: usize> {
  |      ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `foo`
 --> /home/runner/work/glacier/glacier/ices/80531.rs:8:4
  |
8 | fn foo<const N: usize>(val: &ConstGenericEnum<N>) {
  |    ^^^

warning: 3 warnings emitted

==============
@Alexendoo Alexendoo merged commit 2f616dd into master Jan 2, 2021
@Alexendoo Alexendoo deleted the autofix/ices/80531.rs branch January 2, 2021 12:44
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