Skip to content

impl const B only needs impl A for trait B: A #86742

Closed
@fee1-dead

Description

@fee1-dead

From #86571 (comment).

I tried this code (playground):

#![feature(const_trait_impl)]
trait A {}
trait B: A {}

struct Foo;

impl A for Foo {}
impl const B for Foo {}

I expected to see this happen: The compiler might error because Foo does not impl const A

Instead, this happened: This code has no compiler errors.

This is for discussion. I am neither for nor against how this is handled currently.

@rustbot label requires-nightly F-const_trait_impl

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