Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fee1-dead opened this issue Jun 30, 2021 · 0 comments
Closed

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

fee1-dead opened this issue Jun 30, 2021 · 0 comments
Labels
C-bug Category: This is a bug. F-const_trait_impl `#![feature(const_trait_impl)]` requires-nightly This issue requires a nightly compiler in some way.

Comments

@fee1-dead
Copy link
Member

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

@fee1-dead fee1-dead added the C-bug Category: This is a bug. label Jun 30, 2021
@rustbot rustbot added F-const_trait_impl `#![feature(const_trait_impl)]` requires-nightly This issue requires a nightly compiler in some way. labels Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-const_trait_impl `#![feature(const_trait_impl)]` requires-nightly This issue requires a nightly compiler in some way.
Projects
None yet
Development

No branches or pull requests

2 participants