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

ices/60619.rs: fixed with errors #581

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#60619

pub struct Foo<const LEN: usize> {
    buf: [u8; {LEN * 2}]
}

fn main() {}
=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/60619.rs:2:16
  |
2 |     buf: [u8; {LEN * 2}]
  |                ^^^ cannot perform const operation using `LEN`
  |
  = help: const parameters may only be used as standalone arguments, i.e. `LEN`
  = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions

warning: unnecessary braces around const expression
 --> /home/runner/work/glacier/glacier/ices/60619.rs:2:15
  |
2 |     buf: [u8; {LEN * 2}]
  |               ^^^^^^^^^ help: remove these braces
  |
  = note: `#[warn(unused_braces)]` on by default

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/60619.rs:2:16
  |
2 |     buf: [u8; {LEN * 2}]
  |                ^^^ cannot perform const operation using `LEN`
  |
  = help: const parameters may only be used as standalone arguments, i.e. `LEN`
  = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions

warning: unnecessary braces around const expression
 --> /home/runner/work/glacier/glacier/ices/60619.rs:2:15
  |
2 |     buf: [u8; {LEN * 2}]
  |               ^^^^^^^^^ help: remove these braces
  |
  = note: `#[warn(unused_braces)]` on by default

error: aborting due to previous error; 1 warning emitted

==============
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was closed as duplicate.

@Alexendoo Alexendoo deleted the autofix/ices/60619.rs branch January 2, 2021 14:07
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