Skip to content

library: Move unstable API of new_uninit to new features #129416

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

Merged
merged 2 commits into from
Aug 25, 2024

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Aug 22, 2024

  • new_zeroed variants move to new_zeroed_alloc
  • the write fn moves to box_uninit_write

The remainder will be stabilized in upcoming patches, as it was decided to only stabilize uninit* and assume_init.

@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 22, 2024
@workingjubilee workingjubilee force-pushed the partial-move-from-stabilization branch from be94ff0 to 275a526 Compare August 22, 2024 16:24
@workingjubilee
Copy link
Member Author

Further extracted from #129401 as that PR is now waiting on a Tuesday.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

@dtolnay
Copy link
Member

dtolnay commented Aug 22, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 22, 2024

📌 Commit 275a526 has been approved by dtolnay

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 Aug 22, 2024
@dtolnay dtolnay assigned dtolnay and unassigned Mark-Simulacrum Aug 22, 2024
@dtolnay dtolnay removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 22, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 22, 2024
…tabilization, r=dtolnay

library: Move unstable API of new_uninit to new features

- `new_zeroed` variants move to `new_zeroed_alloc`
- the `write` fn moves to `box_uninit_write`

The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 22, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#126985 (Implement `-Z embed-source` (DWARFv5 source code embedding extension))
 - rust-lang#128935 (More work on `zstd` compression)
 - rust-lang#129263 (Add a missing compatibility note in the 1.80.0 release notes)
 - rust-lang#129386 (Use a LocalDefId in ResolvedArg.)
 - rust-lang#129408 (Fix handling of macro arguments within the `dropping_copy_types` lint)
 - rust-lang#129410 (Miri subtree update)
 - rust-lang#129416 (library: Move unstable API of new_uninit to new features)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr
Copy link
Member

@bors r-
#129419 (comment)

@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 Aug 22, 2024
@workingjubilee
Copy link
Member Author

I suppose there isn't a way for Rust-for-Linux to be updated from our repository, huh.

@workingjubilee
Copy link
Member Author

Hey, I opened Rust-for-Linux/linux#1106 but if that PR isn't good enough can one of you take over fixing RfL so we can later land the stabilization of the features you want? Thanks.

@rustbot ping rust-for-linux

@workingjubilee
Copy link
Member Author

@alex
Copy link
Member

alex commented Aug 23, 2024

I see there's a thread on the RfL side, but I do think this points out the need for a clearer process when rust changes "break" rfl's use of unstable apis. We shouldn't assume rust contributors will be familiar with the kernel contribution process

@workingjubilee
Copy link
Member Author

honestly the kernel itself certainly seems like it could benefit from more clearly paving and marking the path here, I didn't expect to wind up in a situation where I feel things like "I seem to be too {neurodivergence} to understand the directions for contributing to... that famous bastion of neurotypicality, the Linux Kernel Mailing List?"

and it seems that RfL does still use PRs, but mostly as a way to borrow the GitHub UI for a slightly less onerous review flow than mailing lists, and then those are routed to the mailing list?

@tgross35
Copy link
Contributor

I see there's a thread on the RfL side, but I do think this points out the need for a clearer process when rust changes "break" rfl's use of unstable apis. We shouldn't assume rust contributors will be familiar with the kernel contribution process

Agreed to this, I think this is the first case we have encountered it.

and it seems that RfL does still use PRs, but mostly as a way to borrow the GitHub UI for a slightly less onerous review flow than mailing lists, and then those are routed to the mailing list?

That is accurate; we usually suggest that changes in early stages can go through a GH PR to collect some loose feedback before being sent to the list, but everything needs to go through the list for review and eventually getting picked up. We can of course help wherever needed - helping anyone figure out how to send patches, or forwarding patches for anyone who has a fix but doesn't know mailing list flow, or just doing the fix as needed.

@Darksonn
Copy link
Contributor

We have a Rust for Linux page in the rustc-dev-guide. We should make sure that this link is shared when the job breaks.

@ojeda
Copy link
Contributor

ojeda commented Aug 23, 2024

Hey, I opened Rust-for-Linux/linux#1106 but if that PR isn't good enough can one of you take over fixing RfL so we can later land the stabilization of the features you want? Thanks.

Thanks!

I see there's a thread on the RfL side, but I do think this points out the need for a clearer process when rust changes "break" rfl's use of unstable apis. We shouldn't assume rust contributors will be familiar with the kernel contribution process

As far as I understood it from the discussions, the idea was to ping us, i.e. it is not expected that Rust contributors need to get familiar with the kernel or its development process. But, of course, if they want to contribute, that is great!

[1] https://rust-lang.zulipchat.com/#narrow/stream/425075-rust-for-linux/topic/building.20on.20Rust.20CI/near/447162810
[2] https://rustc-dev-guide.rust-lang.org/tests/rust-for-linux.html#what-to-do-in-case-of-failure

@workingjubilee
Copy link
Member Author

workingjubilee commented Aug 23, 2024

In general, I do not consult the rustc-dev-guide every time a build breaks. It generally does not change so often that such is useful, and for better or worse, it is rare that a test job is specifically documented inside it. (So Darksonn's idea seems persuasive.)

@workingjubilee
Copy link
Member Author

workingjubilee commented Aug 24, 2024

#129479 (comment)
...an in-std use of new_zeroed... but only on FreeBSD, oddly enough.
@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 Aug 24, 2024
@workingjubilee
Copy link
Member Author

@bors r=dtolnay

@bors
Copy link
Collaborator

bors commented Aug 24, 2024

📌 Commit 90b4e17 has been approved by dtolnay

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 Aug 24, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Aug 24, 2024
…tabilization, r=dtolnay

library: Move unstable API of new_uninit to new features

- `new_zeroed` variants move to `new_zeroed_alloc`
- the `write` fn moves to `box_uninit_write`

The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 24, 2024
…kingjubilee

Rollup of 10 pull requests

Successful merges:

 - rust-lang#127021 (Add target support for RTEMS Arm)
 - rust-lang#128467 (Detect `*` operator on `!Sized` expression)
 - rust-lang#128735 (Add a special case for `CStr`/`CString` in the `improper_ctypes` lint)
 - rust-lang#129416 (library: Move unstable API of new_uninit to new features)
 - rust-lang#129418 (rustc: Simplify getting sysroot library directory)
 - rust-lang#129429 (Print the generic parameter along with the variance in dumps.)
 - rust-lang#129430 (rustdoc: show exact case-sensitive matches first)
 - rust-lang#129449 (Put Pin::as_deref_mut in impl Pin<Ptr> / rearrange Pin methods)
 - rust-lang#129481 (Update `compiler_builtins` to `0.1.121`)
 - rust-lang#129482 (Add myself to the review rotation for libs)

r? `@ghost`
`@rustbot` modify labels: rollup
tgross35 added a commit to tgross35/rust that referenced this pull request Aug 25, 2024
…tabilization, r=dtolnay

library: Move unstable API of new_uninit to new features

- `new_zeroed` variants move to `new_zeroed_alloc`
- the `write` fn moves to `box_uninit_write`

The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 25, 2024
Rollup of 8 pull requests

Successful merges:

 - rust-lang#126985 (Implement `-Z embed-source` (DWARFv5 source code embedding extension))
 - rust-lang#128935 (More work on `zstd` compression)
 - rust-lang#129134 (bootstrap: improve error recovery flags to curl)
 - rust-lang#129190 (Add f16 and f128 to tests/ui/consts/const-float-bits-conv.rs)
 - rust-lang#129416 (library: Move unstable API of new_uninit to new features)
 - rust-lang#129418 (rustc: Simplify getting sysroot library directory)
 - rust-lang#129459 (handle stage0 `cargo` and `rustc` separately)
 - rust-lang#129511 (Update minifier to 0.3.1)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 25, 2024
…tabilization, r=dtolnay

library: Move unstable API of new_uninit to new features

- `new_zeroed` variants move to `new_zeroed_alloc`
- the `write` fn moves to `box_uninit_write`

The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 25, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#128919 (Add an internal lint that warns when accessing untracked data)
 - rust-lang#129134 (bootstrap: improve error recovery flags to curl)
 - rust-lang#129416 (library: Move unstable API of new_uninit to new features)
 - rust-lang#129459 (handle stage0 `cargo` and `rustc` separately)
 - rust-lang#129487 (repr_transparent_external_private_fields: special-case some std types)
 - rust-lang#129511 (Update minifier to 0.3.1)
 - rust-lang#129523 (Make `rustc_type_ir` build on stable)
 - rust-lang#129546 (Get rid of `predicates_defined_on`)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 25, 2024
…tabilization, r=dtolnay

library: Move unstable API of new_uninit to new features

- `new_zeroed` variants move to `new_zeroed_alloc`
- the `write` fn moves to `box_uninit_write`

The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 25, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#129091 (add Box::as_ptr and Box::as_mut_ptr methods)
 - rust-lang#129134 (bootstrap: improve error recovery flags to curl)
 - rust-lang#129416 (library: Move unstable API of new_uninit to new features)
 - rust-lang#129459 (handle stage0 `cargo` and `rustc` separately)
 - rust-lang#129487 (repr_transparent_external_private_fields: special-case some std types)
 - rust-lang#129511 (Update minifier to 0.3.1)
 - rust-lang#129523 (Make `rustc_type_ir` build on stable)

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

Rollup of 7 pull requests

Successful merges:

 - rust-lang#129091 (add Box::as_ptr and Box::as_mut_ptr methods)
 - rust-lang#129134 (bootstrap: improve error recovery flags to curl)
 - rust-lang#129416 (library: Move unstable API of new_uninit to new features)
 - rust-lang#129459 (handle stage0 `cargo` and `rustc` separately)
 - rust-lang#129487 (repr_transparent_external_private_fields: special-case some std types)
 - rust-lang#129511 (Update minifier to 0.3.1)
 - rust-lang#129523 (Make `rustc_type_ir` build on stable)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0e2523e into rust-lang:master Aug 25, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 25, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 25, 2024
Rollup merge of rust-lang#129416 - workingjubilee:partial-move-from-stabilization, r=dtolnay

library: Move unstable API of new_uninit to new features

- `new_zeroed` variants move to `new_zeroed_alloc`
- the `write` fn moves to `box_uninit_write`

The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
@workingjubilee workingjubilee deleted the partial-move-from-stabilization branch August 26, 2024 04:15
ojeda pushed a commit to Rust-for-Linux/linux that referenced this pull request Aug 26, 2024
Upstream Rust's libs-api team has consensus for stabilizing some of
`feature(new_uninit)`, but not for `Box<MaybeUninit<T>>::write`. Instead,
we can use `MaybeUninit<T>::write`, so Rust for Linux can drop the
feature after stabilization. That will happen after merging, as the FCP
has completed [1].

This is required before stabilization because remaining-unstable API
will be divided into new features. This code doesn't know about those
yet. It can't: they haven't landed, as the relevant PR is blocked on
rustc's CI testing Rust-for-Linux without this patch.

[ The PR has landed [2], so we could conditionally enable the new
  unstable feature (`box_uninit_write` [3]) instead, but just for a
  single `unsafe` block it is probably not worth it. For the time being,
  I added it to the "nice to have" section of our unstable features
  list. - Miguel ]

Link: rust-lang/rust#63291 (comment) [1]
Link: rust-lang/rust#129416 [2]
Link: rust-lang/rust#129397 [3]
Signed-off-by: Jubilee Young <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Trevor Gross <[email protected]>
[ Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
ojeda pushed a commit to Rust-for-Linux/linux that referenced this pull request Aug 26, 2024
Upstream Rust's libs-api team has consensus for stabilizing some of
`feature(new_uninit)`, but not for `Box<MaybeUninit<T>>::write`. Instead,
we can use `MaybeUninit<T>::write`, so Rust for Linux can drop the
feature after stabilization. That will happen after merging, as the FCP
has completed [1].

This is required before stabilization because remaining-unstable API
will be divided into new features. This code doesn't know about those
yet. It can't: they haven't landed, as the relevant PR is blocked on
rustc's CI testing Rust-for-Linux without this patch.

[ The PR has landed [2] and will be released in Rust 1.82.0 (expected on
  2024-10-17), so we could conditionally enable the new unstable feature
  (`box_uninit_write` [3]) instead, but just for a single `unsafe` block
  it is probably not worth it. For the time being, I added it to the
  "nice to have" section of our unstable features list. - Miguel ]

Link: rust-lang/rust#63291 (comment) [1]
Link: rust-lang/rust#129416 [2]
Link: rust-lang/rust#129397 [3]
Signed-off-by: Jubilee Young <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Trevor Gross <[email protected]>
[ Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
yhamamachi pushed a commit to yhamamachi/linux-pcie-virtio-net that referenced this pull request Oct 23, 2024
Upstream Rust's libs-api team has consensus for stabilizing some of
`feature(new_uninit)`, but not for `Box<MaybeUninit<T>>::write`. Instead,
we can use `MaybeUninit<T>::write`, so Rust for Linux can drop the
feature after stabilization. That will happen after merging, as the FCP
has completed [1].

This is required before stabilization because remaining-unstable API
will be divided into new features. This code doesn't know about those
yet. It can't: they haven't landed, as the relevant PR is blocked on
rustc's CI testing Rust-for-Linux without this patch.

[ The PR has landed [2] and will be released in Rust 1.82.0 (expected on
  2024-10-17), so we could conditionally enable the new unstable feature
  (`box_uninit_write` [3]) instead, but just for a single `unsafe` block
  it is probably not worth it. For the time being, I added it to the
  "nice to have" section of our unstable features list. - Miguel ]

Link: rust-lang/rust#63291 (comment) [1]
Link: rust-lang/rust#129416 [2]
Link: rust-lang/rust#129397 [3]
Signed-off-by: Jubilee Young <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Trevor Gross <[email protected]>
[ Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.