Skip to content
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

const_trait_impl: super trait not satisfied for generic impl #92230

Closed
fee1-dead opened this issue Dec 23, 2021 · 0 comments · Fixed by #92257
Closed

const_trait_impl: super trait not satisfied for generic impl #92230

fee1-dead opened this issue Dec 23, 2021 · 0 comments · Fixed by #92257
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

fee1-dead commented Dec 23, 2021

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

@fee1-dead fee1-dead added C-bug Category: This is a bug. requires-nightly This issue requires a nightly compiler in some way. F-const_trait_impl `#![feature(const_trait_impl)]` labels Dec 23, 2021
@bors bors closed this as completed in f8abed9 Dec 26, 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

Successfully merging a pull request may close this issue.

1 participant