Open
Description
Code
// check-pass
#![feature(generic_const_items, associated_const_equality)]
#![allow(incomplete_features, dead_code)]
trait Owner {
const K<const N: u16>: u32;
}
impl Owner for () {
const K<const N: u32>: u32 = N + 1;
}
fn take1(_: impl Owner<K<99> = 100>) {}
fn main() {
take1(());
}
Meta
rustc --version --verbose
:
f967532a47eb728ada44473a5c4c2eca1a45fe30
Error output
error[E0053]: const `K` has an incompatible generic parameter for trait `Owner`
--> E3C8E80B9F16D249D1078B5DF2852F8E37EB546C642CE235A1E955910CCB2F71.rs:11:13
|
6 | trait Owner {
| -----
7 | const K<const N: u16>: u32;
| ------------ expected const parameter of type `u16`
...
10 | impl Owner for () {
| -----------------
11 | const K<const N: u32>: u32 = N + 1;
| ^^^^^^^^^^^^ found const parameter of type `u32`
Metadata
Metadata
Assignees
Labels
Category: This is a bug.`#![feature(associated_const_equality)]``#![feature(generic_const_items)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Status: This bug is tracked inside the repo by a `known-bug` test.Relevant 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
Type
Projects
Status
Can Do
Status
Can Do