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

ices/43408.rs: fixed with errors #571

Merged
merged 2 commits into from
Dec 28, 2020
Merged

ices/43408.rs: fixed with errors #571

merged 2 commits into from
Dec 28, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#43408

#![feature(const_fn)]
pub const fn sof<T:?Sized>() -> usize {
    10
}
fn to_byte_array<T>() -> [u8; sof::<T>()] {
     panic!()
}
=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/43408.rs:5:37
  |
5 | fn to_byte_array<T>() -> [u8; sof::<T>()] {
  |                                     ^ 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

error[E0601]: `main` function not found in crate `43408`
 --> /home/runner/work/glacier/glacier/ices/43408.rs:1:1
  |
1 | / #![feature(const_fn)]
2 | | pub const fn sof<T:?Sized>() -> usize {
3 | |     10
4 | | }
5 | | fn to_byte_array<T>() -> [u8; sof::<T>()] {
6 | |      panic!()
7 | | }
  | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/43408.rs`

error: aborting due to 2 previous errors

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

rustbot and others added 2 commits December 28, 2020 12:25
=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/43408.rs:5:37
  |
5 | fn to_byte_array<T>() -> [u8; sof::<T>()] {
  |                                     ^ 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

error[E0601]: `main` function not found in crate `43408`
 --> /home/runner/work/glacier/glacier/ices/43408.rs:1:1
  |
1 | / #![feature(const_fn)]
2 | | pub const fn sof<T:?Sized>() -> usize {
3 | |     10
4 | | }
5 | | fn to_byte_array<T>() -> [u8; sof::<T>()] {
6 | |      panic!()
7 | | }
  | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/43408.rs`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0601`.
==============
@JohnTitor JohnTitor merged commit 96c3dd4 into master Dec 28, 2020
@JohnTitor JohnTitor deleted the autofix/ices/43408.rs branch December 28, 2020 23:16
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