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

ices/90150.rs: fixed with errors #1050

Merged
merged 1 commit into from
Dec 9, 2021
Merged

ices/90150.rs: fixed with errors #1050

merged 1 commit into from
Dec 9, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 9, 2021

Issue: rust-lang/rust#90150

#![feature(inline_const_pat)]
#![feature(generic_const_exprs)]

const fn foo(val: usize) -> usize { val }

fn bar<const N: usize>(num: usize) -> &'static str
where [(); foo(N)]:
{
    match num {
        const { foo(N) } => "fizz",
        _ => "buzz"
    }
}

pub fn main() {}
=== stdout ===
=== stderr ===
warning: the feature `inline_const_pat` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/90150.rs:1:12
  |
1 | #![feature(inline_const_pat)]
  |            ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/90150.rs:2:12
  |
2 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information

error: constant pattern depends on a generic parameter
  --> /home/runner/work/glacier/glacier/ices/90150.rs:10:9
   |
10 |         const { foo(N) } => "fizz",
   |         ^^^^^^^^^^^^^^^^

warning: unreachable pattern
  --> /home/runner/work/glacier/glacier/ices/90150.rs:11:9
   |
10 |         const { foo(N) } => "fizz",
   |         ---------------- matches any value
11 |         _ => "buzz"
   |         ^ unreachable pattern
   |
   = note: `#[warn(unreachable_patterns)]` on by default

error: aborting due to previous error; 3 warnings emitted

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

=== stdout ===
=== stderr ===
warning: the feature `inline_const_pat` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/90150.rs:1:12
  |
1 | #![feature(inline_const_pat)]
  |            ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #76001 <rust-lang/rust#76001> for more information

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/90150.rs:2:12
  |
2 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <rust-lang/rust#76560> for more information

error: constant pattern depends on a generic parameter
  --> /home/runner/work/glacier/glacier/ices/90150.rs:10:9
   |
10 |         const { foo(N) } => "fizz",
   |         ^^^^^^^^^^^^^^^^

warning: unreachable pattern
  --> /home/runner/work/glacier/glacier/ices/90150.rs:11:9
   |
10 |         const { foo(N) } => "fizz",
   |         ---------------- matches any value
11 |         _ => "buzz"
   |         ^ unreachable pattern
   |
   = note: `#[warn(unreachable_patterns)]` on by default

error: aborting due to previous error; 3 warnings emitted

==============
@Alexendoo Alexendoo merged commit 9c3d7c4 into master Dec 9, 2021
@Alexendoo Alexendoo deleted the autofix/ices/90150.rs branch December 9, 2021 14: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.

2 participants