-
Notifications
You must be signed in to change notification settings - Fork 13.3k
implement or-patterns for pattern types #139909
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
Conversation
changes to the core type system Some changes occurred to the CTFE machinery Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri changes to the core type system Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt HIR ty lowering was modified cc @fmease |
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'm not sure if for ty::TyKind::Pat
it makes sense to use a general top level Or
for this 🤔 Though I don't really have a good idea for how everything will turn out in the end so I guess its fine to just do this for now and figure things out at a later date
@rustbot ready |
3c4edc5
to
5de9ffa
Compare
@bors r+ |
Rollup of 7 pull requests Successful merges: - rust-lang#138344 (Enable `reliable_f16_math` on x86) - rust-lang#139909 (implement or-patterns for pattern types) - rust-lang#140392 (compiletest: Remove the libtest-based executor and its dependency) - rust-lang#140400 (PassWrapper: adapt for llvm/llvm-project@d3d856ad8469) - rust-lang#140422 (unwind: bump `unwinding` dependency to 0.2.6) - rust-lang#140432 (Update documentation for `fn target_config`) - rust-lang#140433 (Replace the \01__gnu_mcount_nc to LLVM intrinsic for additional ARM targets) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139909 - oli-obk:or-patterns, r=BoxyUwU implement or-patterns for pattern types These are necessary to represent `NonZeroI32`, as the range for that is `..0 | 1..`. The `rustc_scalar_layout_range_*` attributes avoided this by just implementing wraparound and having a single `1..=-1` range effectively. See https://rust-lang.zulipchat.com/#narrow/channel/481660-t-lang.2Fpattern-types/topic/.60or.20pattern.60.20representation.20in.20type.20system/with/504217694 for some background discussion cc rust-lang#123646 r? `@BoxyUwU`
implement or-patterns for pattern types These are necessary to represent `NonZeroI32`, as the range for that is `..0 | 1..`. The `rustc_scalar_layout_range_*` attributes avoided this by just implementing wraparound and having a single `1..=-1` range effectively. See https://rust-lang.zulipchat.com/#narrow/channel/481660-t-lang.2Fpattern-types/topic/.60or.20pattern.60.20representation.20in.20type.20system/with/504217694 for some background discussion cc rust-lang#123646 r? `@BoxyUwU`
These are necessary to represent
NonZeroI32
, as the range for that is..0 | 1..
. Therustc_scalar_layout_range_*
attributes avoided this by just implementing wraparound and having a single1..=-1
range effectively. See https://rust-lang.zulipchat.com/#narrow/channel/481660-t-lang.2Fpattern-types/topic/.60or.20pattern.60.20representation.20in.20type.20system/with/504217694 for some background discussioncc #123646
r? @BoxyUwU