-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-associated_const_equality`#![feature(associated_const_equality)]``#![feature(associated_const_equality)]`F-generic_const_items`#![feature(generic_const_items)]``#![feature(generic_const_items)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some wayThis issue requires a build of rustc or tooling with debug-assertions in some way
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
C-bugCategory: This is a bug.Category: This is a bug.F-associated_const_equality`#![feature(associated_const_equality)]``#![feature(associated_const_equality)]`F-generic_const_items`#![feature(generic_const_items)]``#![feature(generic_const_items)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some wayThis issue requires a build of rustc or tooling with debug-assertions in some way
Type
Projects
Status
Can Do
Status
Can Do