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

ices/67375.rs: fixed with errors #585

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#67375

struct Bug<T> {
    inner: [(); { [|_: &T| {}; 0].len() }],
}

fn main() {}
=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/67375.rs:2:25
  |
2 |     inner: [(); { [|_: &T| {}; 0].len() }],
  |                         ^ cannot perform const operation using `T`
  |
  = note: type parameters may not be used in const expressions
  = 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/67375.rs:2:17
  |
2 |     inner: [(); { [|_: &T| {}; 0].len() }],
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these braces
  |
  = note: `#[warn(unused_braces)]` on by default

error[E0392]: parameter `T` is never used
 --> /home/runner/work/glacier/glacier/ices/67375.rs:1:12
  |
1 | struct Bug<T> {
  |            ^ unused parameter
  |
  = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`

error: aborting due to 2 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0392`.
==============

=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/67375.rs:2:25
  |
2 |     inner: [(); { [|_: &T| {}; 0].len() }],
  |                         ^ cannot perform const operation using `T`
  |
  = note: type parameters may not be used in const expressions
  = 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/67375.rs:2:17
  |
2 |     inner: [(); { [|_: &T| {}; 0].len() }],
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these braces
  |
  = note: `#[warn(unused_braces)]` on by default

error[E0392]: parameter `T` is never used
 --> /home/runner/work/glacier/glacier/ices/67375.rs:1:12
  |
1 | struct Bug<T> {
  |            ^ unused parameter
  |
  = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`

error: aborting due to 2 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0392`.
==============
@Alexendoo Alexendoo deleted the autofix/ices/67375.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