From 26c652893ee34a089c532b4d0092eb396357c5f4 Mon Sep 17 00:00:00 2001 From: rustbot Date: Mon, 28 Dec 2020 12:25:26 +0000 Subject: [PATCH 1/2] ices/43408.rs: fixed with errors === 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() -> [u8; sof::()] { | ^ 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() -> usize { 3 | | 10 4 | | } 5 | | fn to_byte_array() -> [u8; sof::()] { 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`. ============== --- {ices => fixed}/43408.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {ices => fixed}/43408.rs (100%) diff --git a/ices/43408.rs b/fixed/43408.rs similarity index 100% rename from ices/43408.rs rename to fixed/43408.rs From a196f81bc3bc56aa57e3d1ebb49450d71f6e2dc6 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 29 Dec 2020 08:09:38 +0900 Subject: [PATCH 2/2] Tweak code --- fixed/43408.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fixed/43408.rs b/fixed/43408.rs index 68b895a8..6b70ef42 100644 --- a/fixed/43408.rs +++ b/fixed/43408.rs @@ -2,6 +2,9 @@ pub const fn sof() -> usize { 10 } -fn to_byte_array() -> [u8; sof::()] { - panic!() + +pub fn to_byte_array() -> [u8; sof::()] { + panic!() } + +fn main() {}