-
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
Pattern types: Avoid having to handle an Option for range ends in the type system or the HIR #136922
base: master
Are you sure you want to change the base?
Conversation
changes to the core type system changes to the core type system HIR ty lowering was modified cc @fmease |
This comment has been minimized.
This comment has been minimized.
6b71f0c
to
938cccd
Compare
This comment has been minimized.
This comment has been minimized.
938cccd
to
2e3bbdd
Compare
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
2e3bbdd
to
d979188
Compare
This comment has been minimized.
This comment has been minimized.
d979188
to
ffd9b90
Compare
This comment was marked as resolved.
This comment was marked as resolved.
ffd9b90
to
7da1159
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Something I was thinking about when reviewing this was whether this "normalization" of patterns to always be inclusive w/ both ends specified is something that can be done even when we start to support patterns such as One thing that definitely wont be supported is continuing to lower to an anon const of the form
Implying the right where clauses such that |
7da1159
to
16d3644
Compare
16d3644
to
dd0231e
Compare
dd0231e
to
73b7e5f
Compare
@bors r+ |
… r=BoxyUwU Pattern types: Avoid having to handle an Option for range ends in the type system or the HIR Instead, 1. during hir_ty_lowering, we now generate constants for the min/max when the range doesn't have a start/end specified. 2. in a later commit we generate those constants during ast lowering, simplifying everything further by not having to handle the range end inclusivity anymore in the type system (and thus avoiding any issues of `0..5` being different from `0..=4` I think it makes all the type system code simpler, and the cost of the extra `ConstKind::Value` processing seems negligible. r? `@BoxyUwU` cc `@joshtriplett` `@scottmcm`
Instead,
0..5
being different from0..=4
I think it makes all the type system code simpler, and the cost of the extra
ConstKind::Value
processing seems negligible.r? @BoxyUwU
cc @joshtriplett @scottmcm