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

ices/62708.rs: fixed with errors #582

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#62708

pub struct MultiDriver<D: ?Sized> {
    d: [std::marker::PhantomData<D>; MultiDriver::<D>::MAX_DRIVERS],
}

impl<D: ?Sized> MultiDriver<D> {
    const MAX_DRIVERS: usize = 10;
}
=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/62708.rs:2:52
  |
2 |     d: [std::marker::PhantomData<D>; MultiDriver::<D>::MAX_DRIVERS],
  |                                                    ^ cannot perform const operation using `D`
  |
  = 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

error[E0601]: `main` function not found in crate `62708`
 --> /home/runner/work/glacier/glacier/ices/62708.rs:1:1
  |
1 | / pub struct MultiDriver<D: ?Sized> {
2 | |     d: [std::marker::PhantomData<D>; MultiDriver::<D>::MAX_DRIVERS],
3 | | }
4 | |
5 | | impl<D: ?Sized> MultiDriver<D> {
6 | |     const MAX_DRIVERS: usize = 10;
7 | | }
  | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/62708.rs`

error: aborting due to 2 previous errors

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

=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/62708.rs:2:52
  |
2 |     d: [std::marker::PhantomData<D>; MultiDriver::<D>::MAX_DRIVERS],
  |                                                    ^ cannot perform const operation using `D`
  |
  = 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

error[E0601]: `main` function not found in crate `62708`
 --> /home/runner/work/glacier/glacier/ices/62708.rs:1:1
  |
1 | / pub struct MultiDriver<D: ?Sized> {
2 | |     d: [std::marker::PhantomData<D>; MultiDriver::<D>::MAX_DRIVERS],
3 | | }
4 | |
5 | | impl<D: ?Sized> MultiDriver<D> {
6 | |     const MAX_DRIVERS: usize = 10;
7 | | }
  | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/62708.rs`

error: aborting due to 2 previous errors

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