Skip to content
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

Implement pattern type ffi checks #136193

Merged
merged 4 commits into from
Feb 12, 2025
Merged

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 28, 2025

Previously we just rejected pattern types outright in FFI, but that was never meant to be a permanent situation. We'll need them supported to use them as the building block for NonZero and NonNull after all (both of which are FFI safe).

best reviewed commit by commit.

@rustbot
Copy link
Collaborator

rustbot commented Jan 28, 2025

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Jan 28, 2025
@oli-obk oli-obk force-pushed the pattern-type-ffi-checks branch from 784bbfa to 937866a Compare January 29, 2025 16:37
@chenyukang
Copy link
Member

@bors r=chenyukang

@bors
Copy link
Contributor

bors commented Feb 5, 2025

📌 Commit 937866a has been approved by chenyukang

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 5, 2025
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 5, 2025

@bors rollup

jieyouxu added a commit to jieyouxu/rust that referenced this pull request Feb 5, 2025
…=chenyukang

Implement pattern type ffi checks

Previously we just rejected pattern types outright in FFI, but that was never meant to be a permanent situation. We'll need them supported to use them as the building block for `NonZero` and `NonNull` after all (both of which are FFI safe).

best reviewed commit by commit.
@jieyouxu
Copy link
Member

jieyouxu commented Feb 5, 2025

Seems to have failed in rollup, I think it's this PR?

error[E0599]: no method named `try_to_bits` found for struct `rustc_middle::ty::Const` in the current scope
   --> compiler/rustc_lint/src/types.rs:878:35
    |
878 | ...                   start.try_to_bits(tcx, typing_env).is_some_and(|i| i > 0)
    |                             ^^^^^^^^^^^ method not found in `Const<'_>`

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 5, 2025
@jieyouxu jieyouxu closed this Feb 5, 2025
@jieyouxu jieyouxu reopened this Feb 5, 2025
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the pattern-type-ffi-checks branch from 937866a to 60ed9db Compare February 5, 2025 11:20
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 5, 2025

@bors r=chenyukang

@bors
Copy link
Contributor

bors commented Feb 5, 2025

📌 Commit 60ed9db has been approved by chenyukang

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 5, 2025
@workingjubilee
Copy link
Member

@bors rollup=maybe

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Feb 6, 2025
…=chenyukang

Implement pattern type ffi checks

Previously we just rejected pattern types outright in FFI, but that was never meant to be a permanent situation. We'll need them supported to use them as the building block for `NonZero` and `NonNull` after all (both of which are FFI safe).

best reviewed commit by commit.
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 6, 2025
…kingjubilee

Rollup of 9 pull requests

Successful merges:

 - rust-lang#135439 (Make `-O` mean `OptLevel::Aggressive`)
 - rust-lang#136193 (Implement pattern type ffi checks)
 - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern)
 - rust-lang#136311 (Ensure that we never try to monomorphize the upcasting or vtable calls of impossible dyn types)
 - rust-lang#136315 (Use short ty string for binop and unop errors)
 - rust-lang#136393 (Fix accidentally not emitting overflowing literals lints anymore in patterns)
 - rust-lang#136530 (Implement `x perf` directly in bootstrap)
 - rust-lang#136580 (Couple of changes to run rustc in miri)
 - rust-lang#136589 (Enable "jump to def" feature on rustc docs)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 6, 2025
…kingjubilee

Rollup of 9 pull requests

Successful merges:

 - rust-lang#135439 (Make `-O` mean `OptLevel::Aggressive`)
 - rust-lang#136193 (Implement pattern type ffi checks)
 - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern)
 - rust-lang#136311 (Ensure that we never try to monomorphize the upcasting or vtable calls of impossible dyn types)
 - rust-lang#136315 (Use short ty string for binop and unop errors)
 - rust-lang#136393 (Fix accidentally not emitting overflowing literals lints anymore in patterns)
 - rust-lang#136530 (Implement `x perf` directly in bootstrap)
 - rust-lang#136580 (Couple of changes to run rustc in miri)
 - rust-lang#136589 (Enable "jump to def" feature on rustc docs)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#134367 (Stabilize `feature(trait_upcasting)`)
 - rust-lang#135354 ([Debuginfo] Add MSVC Synthetic and Summary providers to LLDB)
 - rust-lang#135940 (Update toolstate maintainers)
 - rust-lang#135945 (Remove some unnecessary parens in `assert!` conditions)
 - rust-lang#136577 (Pattern Migration 2024: try to suggest eliding redundant binding modifiers)
 - rust-lang#136598 (Fix suggestion for `dependency_on_unit_never_type_fallback` involving closures + format args expansions)
 - rust-lang#136653 (Remove dead code from rustc_codegen_llvm and the LLVM wrapper)
 - rust-lang#136664 (replace one `.map_or(true, ...)` with `.is_none_or(...)`)

Failed merges:

 - rust-lang#136193 (Implement pattern type ffi checks)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 7, 2025
…=chenyukang

Implement pattern type ffi checks

Previously we just rejected pattern types outright in FFI, but that was never meant to be a permanent situation. We'll need them supported to use them as the building block for `NonZero` and `NonNull` after all (both of which are FFI safe).

best reviewed commit by commit.
@bors
Copy link
Contributor

bors commented Feb 7, 2025

☔ The latest upstream changes (presumably #136697) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 7, 2025
@oli-obk oli-obk force-pushed the pattern-type-ffi-checks branch from 60ed9db to f1f996a Compare February 11, 2025 08:52
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 11, 2025

@bors r=chenyukang

@bors
Copy link
Contributor

bors commented Feb 11, 2025

📌 Commit f1f996a has been approved by chenyukang

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 11, 2025
fmease added a commit to fmease/rust that referenced this pull request Feb 11, 2025
…=chenyukang

Implement pattern type ffi checks

Previously we just rejected pattern types outright in FFI, but that was never meant to be a permanent situation. We'll need them supported to use them as the building block for `NonZero` and `NonNull` after all (both of which are FFI safe).

best reviewed commit by commit.
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 11, 2025
Rollup of 7 pull requests

Successful merges:

 - rust-lang#134090 (Stabilize target_feature_11)
 - rust-lang#134999 (Add cygwin target.)
 - rust-lang#135025 (Cast allocas to default address space)
 - rust-lang#135408 (x86: make SSE2 required for i686 hardfloat targets and use it to pass SIMD types)
 - rust-lang#135549 (Document some safety constraints and use more safe wrappers)
 - rust-lang#136193 (Implement pattern type ffi checks)
 - rust-lang#136699 (std: replace the `FromInner` implementation for addresses with private conversion functions)

Failed merges:

 - rust-lang#136758 (tests: `-Copt-level=3` instead of `-O` in assembly tests)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2025
…=chenyukang

Implement pattern type ffi checks

Previously we just rejected pattern types outright in FFI, but that was never meant to be a permanent situation. We'll need them supported to use them as the building block for `NonZero` and `NonNull` after all (both of which are FFI safe).

best reviewed commit by commit.
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#135549 (Document some safety constraints and use more safe wrappers)
 - rust-lang#135965 (In "specify type" suggestion, skip type params that are already known)
 - rust-lang#136193 (Implement pattern type ffi checks)
 - rust-lang#136646 (Add a TyPat in the AST to reuse the generic arg lowering logic)
 - rust-lang#136699 (std: replace the `FromInner` implementation for addresses with private conversion functions)
 - rust-lang#136874 (Change the issue number for `likely_unlikely` and `cold_path`)
 - rust-lang#136884 (Lower fn items as ZST valtrees and delay a bug)
 - rust-lang#136885 (i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#135549 (Document some safety constraints and use more safe wrappers)
 - rust-lang#135965 (In "specify type" suggestion, skip type params that are already known)
 - rust-lang#136193 (Implement pattern type ffi checks)
 - rust-lang#136646 (Add a TyPat in the AST to reuse the generic arg lowering logic)
 - rust-lang#136874 (Change the issue number for `likely_unlikely` and `cold_path`)
 - rust-lang#136884 (Lower fn items as ZST valtrees and delay a bug)
 - rust-lang#136885 (i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change)
 - rust-lang#136891 (Check sig for errors before checking for unconstrained anonymous lifetime)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2f3f83a into rust-lang:master Feb 12, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 12, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2025
Rollup merge of rust-lang#136193 - oli-obk:pattern-type-ffi-checks, r=chenyukang

Implement pattern type ffi checks

Previously we just rejected pattern types outright in FFI, but that was never meant to be a permanent situation. We'll need them supported to use them as the building block for `NonZero` and `NonNull` after all (both of which are FFI safe).

best reviewed commit by commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

7 participants