-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add NonNull pattern types #142339
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
base: master
Are you sure you want to change the base?
Add NonNull pattern types #142339
Conversation
Some changes occurred to the CTFE machinery changes to the core type system Some changes occurred in src/tools/clippy cc @rust-lang/clippy HIR ty lowering was modified cc @fmease Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri The Miri subtree was changed cc @rust-lang/miri Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt changes to the core type system Some changes occurred in compiler/rustc_codegen_ssa |
This comment has been minimized.
This comment has been minimized.
02f19f4
to
57dc73a
Compare
This comment has been minimized.
This comment has been minimized.
57dc73a
to
0adc902
Compare
This comment has been minimized.
This comment has been minimized.
0adc902
to
9944787
Compare
This comment has been minimized.
This comment has been minimized.
9944787
to
8c271d9
Compare
&mut self, | ||
obligation: &PolyTraitObligation<'tcx>, | ||
) -> PredicateObligations<'tcx> { | ||
debug!(?obligation, "confirm_fn_pointer_candidate"); |
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.
Possible copy-paste error:
debug!(?obligation, "confirm_fn_pointer_candidate"); | |
debug!(?obligation, "confirm_pointer_like_candidate"); |
These are the final piece missing for
We cannot use the previous scheme of using an integer range for raw pointers, as we're not just changing the layout of raw pointers anymore, but also the type representation. And we can't represent "any provenance or NonZero" natively as patterns. So I created a new
!null
pattern. Since this is all unstable representation stuff for replacing rustc_layout_scalar_range_start with pattern types, the divergence from normal patterns is fine, especially since T-lang seems interested in exploring general negation patternsr? @BoxyUwU