Skip to content

const_trait_impl: super trait not satisfied for generic impl #92230

Closed
@fee1-dead

Description

@fee1-dead

I tried this code:

#![feature(const_fn_trait_bound)]
#![feature(const_trait_impl)]

pub trait Super {}
pub trait Sub: Super {}

impl<A> const Super for &A where A: ~const Super {}

impl<A> const Sub for &A where A: ~const Sub {}

I expected to see this happen: the code compiles successfully

Instead, this happened: compiler errors saying that error[E0277]: the trait bound `A: Super` is not satisfied

cc @rust-lang/wg-const-eval

playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]`requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions