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

Allow checking whether a type allows being uninitialized #108669

Merged
merged 1 commit into from
Mar 4, 2023

Conversation

Noratrieb
Copy link
Member

This is useful for clippy (rust-lang/clippy#10407) and for the future MaybeUninit::assume_init panics (#100423).

This is useful for clippy and for the future `MaybeUninit::assume_init`
panics.
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2023

r? @wesleywiser

(rustbot has picked a reviewer for you, use r? to override)

@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 Mar 2, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2023

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@compiler-errors
Copy link
Member

@Nilstrieb told me that he was gonna use this in clippy/add usages in a follow-up

@bors r+

@bors
Copy link
Contributor

bors commented Mar 3, 2023

📌 Commit 10a69de has been approved by compiler-errors

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 Mar 3, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2023
Rollup of 6 pull requests

Successful merges:

 - rust-lang#108298 (Fix ICE: check if snippet is `)`)
 - rust-lang#108405 (Lazily compute crate name for consider_optimizing)
 - rust-lang#108656 (Rustdoc search: Emit an error for unclosed generic)
 - rust-lang#108660 (Remove ne implementations from strings)
 - rust-lang#108669 (Allow checking whether a type allows being uninitialized)
 - rust-lang#108727 (rustc_expand: make proc-macro derive error translatable)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6ce78a3 into rust-lang:master Mar 4, 2023
@rustbot rustbot added this to the 1.69.0 milestone Mar 4, 2023
@Noratrieb Noratrieb deleted the query-my-uninitness branch March 4, 2023 14:50
bors added a commit to rust-lang/rust-clippy that referenced this pull request Mar 21, 2023
Use uninit checking from rustc

rustc has proper heuristics for actually checking whether a type allows being left uninitialized (by asking CTFE). We can now use this for our helper instead of rolling our own bad version with false positives.

I added this in rustc in rust-lang/rust#108669

Fix #10407

changelog: [`uninit_vec`]: fix false positives
changelog: [`uninit_assumed_init`]: fix false positives
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.

5 participants