-
Notifications
You must be signed in to change notification settings - Fork 182
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 array types to TypeName
#467
Conversation
8b54f1a
to
e498741
Compare
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.
Couple things
e498741
to
a091c02
Compare
3e43431
to
9fb7842
Compare
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.
LGTM. I would only say that I would like to see a lowering test for the couple different const scenarios here (with or without id)
@Areredify can you look this over once more? Feel free to merge if it looks good to you and CI is green :)
For use in parsing array types
9fb7842
to
2534440
Compare
Updated to apply your suggestions @Areredify, and I also added some more lowering tests as suggested by @jackh726 for good measure. |
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.
This looks good -- my only nit is the "well-formed" condition -- but I don't think I'd block on this, I think that's something we need to do a review of in a more comprehensive fashion, since I think our current support is fragmented.
TypeName::Never | TypeName::Scalar(_) | TypeName::Raw(_) | TypeName::Ref(_) => { | ||
builder.push_fact(trait_ref.clone()) | ||
} | ||
TypeName::Array |
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.
Do we have "WF" condition code somewhere? We'll have to check that the [T;N]
requires T: Sized
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.
We push WF clauses in match_type_name
, and I don't think we had a big discussion about how we want to handle well-formedness of tuples and arrays. IIRC the takeaway was that we rely on rustc to provide well-formed tuples (and, in this case, arrays), but I might be wrong
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.
I guess I was thinking of WfSolver
-- but yeah I think we probably shouldn't block on this right now, it's something we'll definitely want to think about.
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.
We should just file an issue I guess.
|
||
goal { | ||
forall<const N, T> { | ||
WellFormed([T; N]) |
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.
This actually shouldn't hold, I suspect, we don't know that T: Sized
...
Addresses part of #368.