-
Notifications
You must be signed in to change notification settings - Fork 9
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
add story about nalgebra #19
Conversation
With this change, `nalgebra` needs impls like the following | ||
|
||
```rust | ||
impl<T, const R: usize, const C: usize> for SMatrix<T, R, C> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work if the type alias were expanded manually here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, we still only see ConstKind::Unevaluated
in the self type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this case a problem then? For the later cases with exhaustive impls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because you can't write that impl
#![feature(adt_const_params, generic_const_exprs)]
struct Foo<const N: Option<usize>>;
impl<const N: usize> Foo<{ Some(N) }> {}
results in
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
--> src/lib.rs:5:12
|
5 | impl<const N: usize> Foo<{ Some(N) }> {}
| ^ unconstrained const parameter
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks! That's what I was hoping to be the issue, but it wasn't clear to me from the text. To make it a bit simpler, can you a) expand the type alias and b) explain that a generic constant isn't what we actually want, as that is the notion I got from your comment about "constructors being injective"
No description provided.