Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jun 11, 2025

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 patterns

r? @BoxyUwU

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 11, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 11, 2025

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

changes to the core type system

cc @compiler-errors, @lcnr

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

cc @compiler-errors, @lcnr

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the not-null-pattern-types branch from 02f19f4 to 57dc73a Compare June 11, 2025 08:29
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the not-null-pattern-types branch from 57dc73a to 0adc902 Compare June 11, 2025 11:25
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the not-null-pattern-types branch from 0adc902 to 9944787 Compare June 11, 2025 14:51
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the not-null-pattern-types branch from 9944787 to 8c271d9 Compare June 12, 2025 08:00
&mut self,
obligation: &PolyTraitObligation<'tcx>,
) -> PredicateObligations<'tcx> {
debug!(?obligation, "confirm_fn_pointer_candidate");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible copy-paste error:

Suggested change
debug!(?obligation, "confirm_fn_pointer_candidate");
debug!(?obligation, "confirm_pointer_like_candidate");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants