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

ices/67945-4.rs: fixed with errors #587

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#67945

// reproducer by nikomatsakis
use std::marker::PhantomData;

use std::mem::{self, MaybeUninit};

struct Bug<S> {
    A: [(); {
        let x: Option<Box<S>> = None;
        0
    }],
}
=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/67945-4.rs:8:27
  |
8 |         let x: Option<Box<S>> = None;
  |                           ^ cannot perform const operation using `S`
  |
  = 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: unused import: `std::marker::PhantomData`
 --> /home/runner/work/glacier/glacier/ices/67945-4.rs:2:5
  |
2 | use std::marker::PhantomData;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused imports: `MaybeUninit`, `self`
 --> /home/runner/work/glacier/glacier/ices/67945-4.rs:4:16
  |
4 | use std::mem::{self, MaybeUninit};
  |                ^^^^  ^^^^^^^^^^^

error[E0601]: `main` function not found in crate `67945_4`
  --> /home/runner/work/glacier/glacier/ices/67945-4.rs:2:1
   |
2  | / use std::marker::PhantomData;
3  | |
4  | | use std::mem::{self, MaybeUninit};
5  | |
...  |
10 | |     }],
11 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/67945-4.rs`

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

error: aborting due to 3 previous errors; 2 warnings emitted

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

=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/67945-4.rs:8:27
  |
8 |         let x: Option<Box<S>> = None;
  |                           ^ cannot perform const operation using `S`
  |
  = 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: unused import: `std::marker::PhantomData`
 --> /home/runner/work/glacier/glacier/ices/67945-4.rs:2:5
  |
2 | use std::marker::PhantomData;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused imports: `MaybeUninit`, `self`
 --> /home/runner/work/glacier/glacier/ices/67945-4.rs:4:16
  |
4 | use std::mem::{self, MaybeUninit};
  |                ^^^^  ^^^^^^^^^^^

error[E0601]: `main` function not found in crate `67945_4`
  --> /home/runner/work/glacier/glacier/ices/67945-4.rs:2:1
   |
2  | / use std::marker::PhantomData;
3  | |
4  | | use std::mem::{self, MaybeUninit};
5  | |
...  |
10 | |     }],
11 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/67945-4.rs`

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

error: aborting due to 3 previous errors; 2 warnings emitted

Some errors have detailed explanations: E0392, E0601.
For more information about an error, try `rustc --explain E0392`.
==============
@Alexendoo Alexendoo deleted the autofix/ices/67945-4.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