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

ices/94627.rs: fixed with errors #1169

Merged
merged 1 commit into from
Mar 14, 2022
Merged

ices/94627.rs: fixed with errors #1169

merged 1 commit into from
Mar 14, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#94627

struct Bug<S> {
    A: [(); {
        let x: [u8; Self::W] = [0; Self::W];
        F
    }
}

fn main() {}
=== stdout ===
=== stderr ===
error: mismatched closing delimiter: `}`
 --> /home/runner/work/glacier/glacier/ices/94627.rs:2:8
  |
1 | struct Bug<S> {
  |               - closing delimiter possibly meant for this
2 |     A: [(); {
  |        ^ unclosed delimiter
...
6 | }
  | ^ mismatched closing delimiter

error[E0425]: cannot find value `F` in this scope
 --> /home/runner/work/glacier/glacier/ices/94627.rs:4:9
  |
4 |         F
  |         ^
  |
help: a local variable with a similar name exists
  |
4 |         x
  |
help: you might be missing a type parameter
  |
1 | struct Bug<S, F> {
  |             +++

error: generic `Self` types are currently not permitted in anonymous constants
 --> /home/runner/work/glacier/glacier/ices/94627.rs:3:21
  |
3 |         let x: [u8; Self::W] = [0; Self::W];
  |                     ^^^^

error: generic `Self` types are currently not permitted in anonymous constants
 --> /home/runner/work/glacier/glacier/ices/94627.rs:3:36
  |
3 |         let x: [u8; Self::W] = [0; Self::W];
  |                                    ^^^^

error[E0277]: the size for values of type `S` cannot be known at compilation time
 --> /home/runner/work/glacier/glacier/ices/94627.rs:3:36
  |
1 | struct Bug<S> {
  |            - this type parameter needs to be `std::marker::Sized`
2 |     A: [(); {
3 |         let x: [u8; Self::W] = [0; Self::W];
  |                                    ^^^^^^^ doesn't have a size known at compile-time
  |
note: required by a bound in `Bug`
 --> /home/runner/work/glacier/glacier/ices/94627.rs:1:12
  |
1 | struct Bug<S> {
  |            ^ required by this bound in `Bug`
help: consider relaxing the implicit `Sized` restriction
  |
1 | struct Bug<S: ?Sized> {
  |             ++++++++

error[E0392]: parameter `S` is never used
 --> /home/runner/work/glacier/glacier/ices/94627.rs:1:12
  |
1 | struct Bug<S> {
  |            ^ unused parameter
  |
  = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData`
  = help: if you intended `S` to be a const parameter, use `const S: usize` instead

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0277, E0392, E0425.
For more information about an error, try `rustc --explain E0277`.
==============

=== stdout ===
=== stderr ===
error: mismatched closing delimiter: `}`
 --> /home/runner/work/glacier/glacier/ices/94627.rs:2:8
  |
1 | struct Bug<S> {
  |               - closing delimiter possibly meant for this
2 |     A: [(); {
  |        ^ unclosed delimiter
...
6 | }
  | ^ mismatched closing delimiter

error[E0425]: cannot find value `F` in this scope
 --> /home/runner/work/glacier/glacier/ices/94627.rs:4:9
  |
4 |         F
  |         ^
  |
help: a local variable with a similar name exists
  |
4 |         x
  |
help: you might be missing a type parameter
  |
1 | struct Bug<S, F> {
  |             +++

error: generic `Self` types are currently not permitted in anonymous constants
 --> /home/runner/work/glacier/glacier/ices/94627.rs:3:21
  |
3 |         let x: [u8; Self::W] = [0; Self::W];
  |                     ^^^^

error: generic `Self` types are currently not permitted in anonymous constants
 --> /home/runner/work/glacier/glacier/ices/94627.rs:3:36
  |
3 |         let x: [u8; Self::W] = [0; Self::W];
  |                                    ^^^^

error[E0277]: the size for values of type `S` cannot be known at compilation time
 --> /home/runner/work/glacier/glacier/ices/94627.rs:3:36
  |
1 | struct Bug<S> {
  |            - this type parameter needs to be `std::marker::Sized`
2 |     A: [(); {
3 |         let x: [u8; Self::W] = [0; Self::W];
  |                                    ^^^^^^^ doesn't have a size known at compile-time
  |
note: required by a bound in `Bug`
 --> /home/runner/work/glacier/glacier/ices/94627.rs:1:12
  |
1 | struct Bug<S> {
  |            ^ required by this bound in `Bug`
help: consider relaxing the implicit `Sized` restriction
  |
1 | struct Bug<S: ?Sized> {
  |             ++++++++

error[E0392]: parameter `S` is never used
 --> /home/runner/work/glacier/glacier/ices/94627.rs:1:12
  |
1 | struct Bug<S> {
  |            ^ unused parameter
  |
  = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData`
  = help: if you intended `S` to be a const parameter, use `const S: usize` instead

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0277, E0392, E0425.
For more information about an error, try `rustc --explain E0277`.
==============
@Alexendoo Alexendoo merged commit 11def39 into master Mar 14, 2022
@Alexendoo Alexendoo deleted the autofix/ices/94627.rs branch March 14, 2022 13:23
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