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

ices/67405.rs: fixed with errors #276

Merged
merged 1 commit into from
Jan 29, 2020
Merged

ices/67405.rs: fixed with errors #276

merged 1 commit into from
Jan 29, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#67405

struct Bug {
    inner: [(); match || 1 {
        n => n(),
    }],
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0658]: `match` is not allowed in a `const`
 --> /home/runner/work/glacier/glacier/ices/67405.rs:2:17
  |
2 |       inner: [(); match || 1 {
  |  _________________^
3 | |         n => n(),
4 | |     }],
  | |_____^
  |
  = note: for more information, see https://github.com/rust-lang/rust/issues/49146
  = help: add `#![feature(const_if_match)]` to the crate attributes to enable

error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
 --> /home/runner/work/glacier/glacier/ices/67405.rs:3:14
  |
3 |         n => n(),
  |              ^^^

error[E0080]: evaluation of constant value failed
 --> /home/runner/work/glacier/glacier/ices/67405.rs:3:14
  |
3 |         n => n(),
  |              ^^^ calling non-const function `Bug::inner::{{constant}}#0::{{closure}}#0`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0015, E0080, E0658.
For more information about an error, try `rustc --explain E0015`.
==============

=== stdout ===
=== stderr ===
error[E0658]: `match` is not allowed in a `const`
 --> /home/runner/work/glacier/glacier/ices/67405.rs:2:17
  |
2 |       inner: [(); match || 1 {
  |  _________________^
3 | |         n => n(),
4 | |     }],
  | |_____^
  |
  = note: for more information, see rust-lang/rust#49146
  = help: add `#![feature(const_if_match)]` to the crate attributes to enable

error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
 --> /home/runner/work/glacier/glacier/ices/67405.rs:3:14
  |
3 |         n => n(),
  |              ^^^

error[E0080]: evaluation of constant value failed
 --> /home/runner/work/glacier/glacier/ices/67405.rs:3:14
  |
3 |         n => n(),
  |              ^^^ calling non-const function `Bug::inner::{{constant}}#0::{{closure}}#0`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0015, E0080, E0658.
For more information about an error, try `rustc --explain E0015`.
==============
@Alexendoo Alexendoo merged commit fb1082d into master Jan 29, 2020
@Alexendoo Alexendoo deleted the autofix/ices/67405.rs branch January 29, 2020 12:18
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.

3 participants