Closed
Description
Code
trait Trait {}
impl Trait for bool {}
struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T);
type MySliceBool = MySlice<[bool]>;
const MYSLICE_GOOD: &MySliceBool = &MySlice(true, [false]);
fn main() {}
Meta
rustc --version --verbose
:
26cd5d862e22c013ecb3396b177d3af80e95c836
Error output
error[E0412]: cannot find type `Idx` in this scope
--> ice.rs:3:30
|
3 | struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T);
| ^^^ not found in this scope
error[E0412]: cannot find type `Idx` in this scope
--> ice.rs:3:38
|
3 | struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T);
| ^^^ not found in this scope
error[E0277]: the size for values of type `[bool]` cannot be known at compilation time
--> ice.rs:5:22
|
5 | const MYSLICE_GOOD: &MySliceBool = &MySlice(true, [false]);
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[bool]`
note: required by an implicit `Sized` bound in `MySlice`
--> ice.rs:3:16
|
3 | struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T);
| ^ required by the implicit `Sized` requirement on this type parameter in `MySlice`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> ice.rs:3:16
|
3 | struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T);
| ^ - ...if indirection were used here: `Box<T>`
| |
| this could be changed to `T: ?Sized`...
Metadata
Metadata
Assignees
Labels
Area: Constant evaluation, covers all const contexts (static, const fn, ...)Category: This is a bug.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Status: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.This issue requires a build of rustc or tooling with debug-assertions in some way