Skip to content

Duplicate bounds behave differently depending on their order for const_trait_impl #88383

Closed
@fee1-dead

Description

@fee1-dead

I tried this code:

const fn equals_self<T: PartialEq + ~const PartialEq>(t: &T) -> bool {
    *t == *t
}

I expected to see this happen: It should be the same as

const fn equals_self<T: ~const PartialEq + PartialEq>(t: &T) -> bool {
    *t == *t
}

Instead, this happened: It errors for the former but does not error for the second example.

@rustbot label F-const_trait_impl

See https://github.com/rust-lang/rust/pull/88328/files#r697229693

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions