-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]``#![feature(const_trait_impl)]`F-min_specialization`#![feature(min_specialization)]``#![feature(min_specialization)]`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.
Description
#![feature(const_trait_impl, min_specialization)]
#[allow(dead_code)]
#[const_trait]
trait Trait {
fn item();
}
impl<T> const Trait for T {
default fn item() {}
}
// works when adding const here too
impl Trait for () {
fn item() {}
}
fn main() {}error[E0119]: conflicting implementations of trait `Trait` for type `()`
--> conflict.rs:14:1
|
9 | impl<T> const Trait for T {
| ------------------------- first implementation here
...
14 | impl Trait for () {
| ^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0119`.
rustc 1.92.0-nightly (4082d6a3f 2025-09-27)
i would like to expect this to work it may however be intentional behaviour
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]``#![feature(const_trait_impl)]`F-min_specialization`#![feature(min_specialization)]``#![feature(min_specialization)]`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.