-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 generic expressions fail to error at anonymous const (?) #137659
Comments
@rootnas the link you shared does not work for me (404s). Do you have a reproducer elsewhere? |
Also, does your example use |
My apologies, I forgot to make it visible. May also not be cached where you are. It should work now. |
Yes, it does use that feature. Yes, it is maybe a duplicate, but I don't know much about rustc so I can't say for sure. Let me repost the example here. |
lib.rs #![feature(generic_const_exprs)]
use std::ops::Add;
#[derive(Debug, Copy, Clone)]
pub struct Foo<const A: i8>;
impl<const A: i8, const B: i8> Add<Foo<B>> for Foo<A>
where
Foo<{
A + B
}>: Sized {
type Output = Foo<{
A + B
}>;
fn add(self, _: Foo<B>) -> Self::Output {
Foo
}
} main.rs use ice::Foo;
fn ices(foo: Foo<1>) -> Foo<2> {
(foo + foo).into()
}
fn main() { } |
This is a duplicate of #133199 (if a crate has |
Closing in favor of #133199 |
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: