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

Partial stabilization of once_cell #105587

Merged
merged 3 commits into from
Mar 30, 2023
Merged

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Dec 12, 2022

This PR aims to stabilize a portion of the once_cell feature:

  • core::cell::OnceCell
  • std::cell::OnceCell (re-export of the above)
  • std::sync::OnceLock

This will leave LazyCell and LazyLock unstabilized, which have been moved to the lazy_cell feature flag.

Tracking issue: #74465 (does not fully close, but it may make sense to move to a new issue)

Future steps for separate PRs:

To be stabilized API summary

// core::cell (in core/cell/once.rs)

pub struct OnceCell<T> { .. }

impl<T> OnceCell<T> {
    pub const fn new() -> OnceCell<T>;
    pub fn get(&self) -> Option<&T>;
    pub fn get_mut(&mut self) -> Option<&mut T>;
    pub fn set(&self, value: T) -> Result<(), T>;
    pub fn get_or_init<F>(&self, f: F) -> &T where F: FnOnce() -> T;
    pub fn into_inner(self) -> Option<T>;
    pub fn take(&mut self) -> Option<T>;
}

impl<T: Clone> Clone for OnceCell<T>;
impl<T: Debug> Debug for OnceCell<T>
impl<T> Default for OnceCell<T>;
impl<T> From<T> for OnceCell<T>;
impl<T: PartialEq> PartialEq for OnceCell<T>;
impl<T: Eq> Eq for OnceCell<T>;
// std::sync (in std/sync/once_lock.rs)

impl<T> OnceLock<T> {
    pub const fn new() -> OnceLock<T>;
    pub fn get(&self) -> Option<&T>;
    pub fn get_mut(&mut self) -> Option<&mut T>;
    pub fn set(&self, value: T) -> Result<(), T>;
    pub fn get_or_init<F>(&self, f: F) -> &T where F: FnOnce() -> T;
    pub fn into_inner(self) -> Option<T>;
    pub fn take(&mut self) -> Option<T>;
}

impl<T: Clone> Clone for OnceLock<T>;
impl<T: Debug> Debug for OnceLock<T>;
impl<T> Default for OnceLock<T>;
impl<#[may_dangle] T> Drop for OnceLock<T>;
impl<T> From<T> for OnceLock<T>;
impl<T: PartialEq> PartialEq for OnceLock<T>
impl<T: Eq> Eq for OnceLock<T>;
impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceLock<T>;
unsafe impl<T: Send> Send for OnceLock<T>;
unsafe impl<T: Sync + Send> Sync for OnceLock<T>;
impl<T: UnwindSafe> UnwindSafe for OnceLock<T>;

No longer planned as part of this PR, and moved to the rust_cell_try feature gate:

impl<T> OnceCell<T> {
    pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E> where F: FnOnce() -> Result<T, E>;
}

impl<T> OnceLock<T> {
    pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E> where F: FnOnce() -> Result<T, E>;
}

I am new to this process so would appreciate mentorship wherever needed.

Post-merge update

With this merge, LazyCell and LazyLock have been moved under the gate lazy_cell (see #109736) and the get_or_try_init functions are under once_cell_try (see #109737)

@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2022

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @m-ou-se (or someone else) soon.

Please see the contribution instructions for more information.

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 Dec 12, 2022
@tgross35 tgross35 marked this pull request as ready for review December 12, 2022 07:19
@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@tgross35
Copy link
Contributor Author

This needs FCP still

@rustbot modify labels: +T-libs-api

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Dec 12, 2022
@tgross35 tgross35 mentioned this pull request Dec 12, 2022
9 tasks
@programmerjake
Copy link
Member

looks like you're stabilizing OnceLock, not LazyCell...the top comment should be fixed

@inquisitivecrystal inquisitivecrystal added relnotes Marks issues that should be documented in the release notes of the next release. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. and removed 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. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) labels Dec 12, 2022
@tgross35
Copy link
Contributor Author

Updated, thanks for the catch

@rustbot rustbot added the A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) label Dec 12, 2022
@inquisitivecrystal inquisitivecrystal removed the A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) label Dec 12, 2022
@klensy
Copy link
Contributor

klensy commented Dec 12, 2022

If this PR about stabilization, why slapping inline all over methods?

@rustbot rustbot added the A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) label Dec 12, 2022
@tgross35
Copy link
Contributor Author

tgross35 commented Dec 12, 2022

I just did not know if those were typically added at this time, since these functions are fairly good use cases. I have removed them, matklad suggested we can add them later

Edit: Moved this to #105651

@m-ou-se
Copy link
Member

m-ou-se commented Dec 30, 2022

@rfcbot merge

@rfcbot
Copy link

rfcbot commented Dec 30, 2022

Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Jun 3, 2023
Pkgsrc changes:
 * Adjust patches and cargo checksums to new versions.
 * Adjust to not cross-build to 8.0, due to LLVM using c++17,
   so adjust USE_LANGUAGES.

Upstream changes:

Version 1.70.0 (2023-06-01)
==========================

Language
--------
- [Relax ordering rules for `asm!` operands]
  (rust-lang/rust#105798)
- [Properly allow macro expanded `format_args` invocations to uses
  captures] (rust-lang/rust#106505)
- [Lint ambiguous glob re-exports]
  (rust-lang/rust#107880)
- [Perform const and unsafe checking for expressions in `let _ =
  expr` position.]
  (rust-lang/rust#102256)

Compiler
--------
- [Extend -Cdebuginfo with new options and named aliases]
  (rust-lang/rust#109808)
  This provides a smaller version of debuginfo for cases that only
  need line number information (`-Cdebuginfo=line-tables-only`),
  which may eventually become the default for `-Cdebuginfo=1`.
- [Make `unused_allocation` lint against `Box::new` too]
  (rust-lang/rust#104363)
- [Detect uninhabited types early in const eval]
  (rust-lang/rust#109435)
- [Switch to LLD as default linker for {arm,thumb}v4t-none-eabi]
  (rust-lang/rust#109721)
- [Add tier 3 target `loongarch64-unknown-linux-gnu`]
  (rust-lang/rust#96971)
- [Add tier 3 target for `i586-pc-nto-qnx700` (QNX Neutrino RTOS,
  version 7.0)] (rust-lang/rust#109173),
- [Insert alignment checks for pointer dereferences as debug assertions]
  (rust-lang/rust#98112)
  This catches undefined behavior at runtime, and may cause existing
  code to fail.

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------
- [Document NonZeroXxx layout guarantees]
  (rust-lang/rust#94786)
- [Windows: make `Command` prefer non-verbatim paths]
  (rust-lang/rust#96391)
- [Implement Default for some alloc/core iterators]
  (rust-lang/rust#99929)
- [Fix handling of trailing bare CR in str::lines]
  (rust-lang/rust#100311)
- [allow negative numeric literals in `concat!`]
  (rust-lang/rust#106844)
- [Add documentation about the memory layout of `Cell`]
  (rust-lang/rust#106921)
- [Use `partial_cmp` to implement tuple `lt`/`le`/`ge`/`gt`]
  (rust-lang/rust#108157)
- [Stabilize `atomic_as_ptr`]
  (rust-lang/rust#108419)
- [Stabilize `nonnull_slice_from_raw_parts`]
  (rust-lang/rust#97506)
- [Partial stabilization of `once_cell`]
  (rust-lang/rust#105587)
- [Stabilize `nonzero_min_max`]
  (rust-lang/rust#106633)
- [Flatten/inline format_args!() and (string and int) literal
  arguments into format_args!()]
  (rust-lang/rust#106824)
- [Stabilize movbe target feature]
  (rust-lang/rust#107711)
- [don't splice from files into pipes in io::copy]
  (rust-lang/rust#108283)
- [Add a builtin unstable `FnPtr` trait that is implemented for
  all function pointers]
  (rust-lang/rust#108080)
  This extends `Debug`, `Pointer`, `Hash`, `PartialEq`, `Eq`,
  `PartialOrd`, and `Ord` implementations for function pointers
  with all ABIs.

Stabilized APIs
---------------

- [`NonZero*::MIN/MAX`]
  (https://doc.rust-lang.org/stable/std/num/struct.NonZeroI8.html#associatedconstant.MIN)
- [`BinaryHeap::retain`]
  (https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap.html#method.retain)
- [`Default for std::collections::binary_heap::IntoIter`]
  (https://doc.rust-lang.org/stable/std/collections/binary_heap/struct.IntoIter.html)
- [`Default for std::collections::btree_map::{IntoIter, Iter, IterMut}`]
  (https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoIter.html)
- [`Default for std::collections::btree_map::{IntoKeys, Keys}`]
  (https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoKeys.html)
- [`Default for std::collections::btree_map::{IntoValues, Values}`]
  (https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoKeys.html)
- [`Default for std::collections::btree_map::Range`]
  (https://doc.rust-lang.org/stable/std/collections/btree_map/struct.Range.html)
- [`Default for std::collections::btree_set::{IntoIter, Iter}`]
  (https://doc.rust-lang.org/stable/std/collections/btree_set/struct.IntoIter.html)
- [`Default for std::collections::btree_set::Range`]
  (https://doc.rust-lang.org/stable/std/collections/btree_set/struct.Range.html)
- [`Default for std::collections::linked_list::{IntoIter, Iter, IterMut}`]
  (https://doc.rust-lang.org/stable/alloc/collections/linked_list/struct.IntoIter.html)
- [`Default for std::vec::IntoIter`]
  (https://doc.rust-lang.org/stable/alloc/vec/struct.IntoIter.html#impl-Default-for-IntoIter%3CT,+A%3E)
- [`Default for std::iter::Chain`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Chain.html)
- [`Default for std::iter::Cloned`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Cloned.html)
- [`Default for std::iter::Copied`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Copied.html)
- [`Default for std::iter::Enumerate`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Enumerate.html)
- [`Default for std::iter::Flatten`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Flatten.html)
- [`Default for std::iter::Fuse`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Fuse.html)
- [`Default for std::iter::Rev`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Rev.html)
- [`Default for std::slice::Iter`]
  (https://doc.rust-lang.org/stable/std/slice/struct.Iter.html)
- [`Default for std::slice::IterMut`]
  (https://doc.rust-lang.org/stable/std/slice/struct.IterMut.html)
- [`Rc::into_inner`]
  (https://doc.rust-lang.org/stable/alloc/rc/struct.Rc.html#method.into_inner)
- [`Arc::into_inner`]
  (https://doc.rust-lang.org/stable/alloc/sync/struct.Arc.html#method.into_inner)
- [`std::cell::OnceCell`]
  (https://doc.rust-lang.org/stable/std/cell/struct.OnceCell.html)
- [`Option::is_some_and`]
  (https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.is_some_and)
- [`NonNull::slice_from_raw_parts`]
  (https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.slice_from_raw_parts)
- [`Result::is_ok_and`]
  (https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.is_ok_and)
- [`Result::is_err_and`]
  (https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.is_err_and)
- [`std::sync::atomic::Atomic*::as_ptr`]
  (https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicU8.html#method.as_ptr)
- [`std::io::IsTerminal`]
  (https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html)
- [`std::os::linux::net::SocketAddrExt`]
  (https://doc.rust-lang.org/stable/std/os/linux/net/trait.SocketAddrExt.html)
- [`std::os::unix::net::UnixDatagram::bind_addr`]
  (https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.bind_addr)
- [`std::os::unix::net::UnixDatagram::connect_addr`]
  (https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.connect_addr)
- [`std::os::unix::net::UnixDatagram::send_to_addr`]
  (https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.send_to_addr)
- [`std::os::unix::net::UnixListener::bind_addr`]
  (https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixListener.html#method.bind_addr)
- [`std::path::Path::as_mut_os_str`]
  (https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.as_mut_os_str)
- [`std::sync::OnceLock`]
  (https://doc.rust-lang.org/stable/std/sync/struct.OnceLock.html)

Cargo
-----

- [Add `CARGO_PKG_README`]
  (rust-lang/cargo#11645)
- [Make `sparse` the default protocol for crates.io]
  (rust-lang/cargo#11791)
- [Accurately show status when downgrading dependencies]
  (rust-lang/cargo#11839)
- [Use registry.default for login/logout]
  (rust-lang/cargo#11949)
- [Stabilize `cargo logout`]
  (rust-lang/cargo#11950)

Misc
----

- [Stabilize rustdoc `--test-run-directory`]
  (rust-lang/rust#103682)

Compatibility Notes
-------------------

- [Prevent stable `libtest` from supporting `-Zunstable-options`]
  (rust-lang/rust#109044)
- [Perform const and unsafe checking for expressions in `let _ =
  expr` position.] (rust-lang/rust#102256)
- [WebAssembly targets enable `sign-ext` and `mutable-globals`
  features in codegen] (rust-lang/rust#109807)
  This may cause incompatibility with older execution environments.
- [Insert alignment checks for pointer dereferences as debug assertions]
  (rust-lang/rust#98112)
  This catches undefined behavior at runtime, and may cause existing
  code to fail.

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Upgrade to LLVM 16]
  (rust-lang/rust#109474)
- [Use SipHash-1-3 instead of SipHash-2-4 for StableHasher]
  (rust-lang/rust#107925)
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jul 10, 2023
Pkgsrc changes:
 * Adjust patches and cargo checksums to new versions.
 * Add support for NetBSD/riscv64.

Upstream changes:

Version 1.70.0 (2023-06-01)
==========================

Language
--------
- [Relax ordering rules for `asm!` operands]
  (rust-lang/rust#105798)
- [Properly allow macro expanded `format_args` invocations to uses captures]
  (rust-lang/rust#106505)
- [Lint ambiguous glob re-exports]
  (rust-lang/rust#107880)
- [Perform const and unsafe checking for expressions in `let _ =
  expr` position.]
  (rust-lang/rust#102256)

Compiler
--------
- [Extend -Cdebuginfo with new options and named aliases]
  (rust-lang/rust#109808)
  This provides a smaller version of debuginfo for cases that only
  need line number information (`-Cdebuginfo=line-tables-only`),
  which may eventually become the default for `-Cdebuginfo=1`.
- [Make `unused_allocation` lint against `Box::new` too]
  (rust-lang/rust#104363)
- [Detect uninhabited types early in const eval]
  (rust-lang/rust#109435)
- [Switch to LLD as default linker for {arm,thumb}v4t-none-eabi]
  (rust-lang/rust#109721)
- [Add tier 3 target `loongarch64-unknown-linux-gnu`]
  (rust-lang/rust#96971)
- [Add tier 3 target for `i586-pc-nto-qnx700`(QNX Neutrino RTOS, version 7.0)]
  (rust-lang/rust#109173),
- [Insert alignment checks for pointer dereferences as debug assertions]
  (rust-lang/rust#98112)
  This catches undefined behavior at runtime, and may cause existing
  code to fail.

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------
- [Document NonZeroXxx layout guarantees]
  (rust-lang/rust#94786)
- [Windows: make `Command` prefer non-verbatim paths]
  (rust-lang/rust#96391)
- [Implement Default for some alloc/core iterators]
  (rust-lang/rust#99929)
- [Fix handling of trailing bare CR in str::lines]
  (rust-lang/rust#100311)
- [allow negative numeric literals in `concat!`]
  (rust-lang/rust#106844)
- [Add documentation about the memory layout of `Cell`]
  (rust-lang/rust#106921)
- [Use `partial_cmp` to implement tuple `lt`/`le`/`ge`/`gt`]
  (rust-lang/rust#108157)
- [Stabilize `atomic_as_ptr`]
  (rust-lang/rust#108419)
- [Stabilize `nonnull_slice_from_raw_parts`]
  (rust-lang/rust#97506)
- [Partial stabilization of `once_cell`]
  (rust-lang/rust#105587)
- [Stabilize `nonzero_min_max`]
  (rust-lang/rust#106633)
- [Flatten/inline format_args!() and (string and int) literal
  arguments into format_args!()]
  (rust-lang/rust#106824)
- [Stabilize movbe target feature]
  (rust-lang/rust#107711)
- [don't splice from files into pipes in io::copy]
  (rust-lang/rust#108283)
- [Add a builtin unstable `FnPtr` trait that is implemented for
  all function pointers]
  (rust-lang/rust#108080)
  This extends `Debug`, `Pointer`, `Hash`, `PartialEq`, `Eq`,
  `PartialOrd`, and `Ord` implementations for function pointers
  with all ABIs.


Stabilized APIs
---------------

- [`NonZero*::MIN/MAX`]
  (https://doc.rust-lang.org/stable/std/num/struct.NonZeroI8.html#associatedconstant.MIN)
- [`BinaryHeap::retain`]
  (https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap.html#method.retain)
- [`Default for std::collections::binary_heap::IntoIter`]
  (https://doc.rust-lang.org/stable/std/collections/binary_heap/struct.IntoIter.html)
- [`Default for std::collections::btree_map::{IntoIter, Iter, IterMut}`]
  (https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoIter.html)
- [`Default for std::collections::btree_map::{IntoKeys, Keys}`]
  (https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoKeys.html)
- [`Default for std::collections::btree_map::{IntoValues, Values}`]
  (https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoKeys.html)
- [`Default for std::collections::btree_map::Range`]
  (https://doc.rust-lang.org/stable/std/collections/btree_map/struct.Range.html)
- [`Default for std::collections::btree_set::{IntoIter, Iter}`]
  (https://doc.rust-lang.org/stable/std/collections/btree_set/struct.IntoIter.html)
- [`Default for std::collections::btree_set::Range`]
  (https://doc.rust-lang.org/stable/std/collections/btree_set/struct.Range.html)
- [`Default for std::collections::linked_list::{IntoIter, Iter, IterMut}`]
  (https://doc.rust-lang.org/stable/alloc/collections/linked_list/struct.IntoIter.html)
- [`Default for std::vec::IntoIter`]
  (https://doc.rust-lang.org/stable/alloc/vec/struct.IntoIter.html#impl-Default-for-IntoIter%3CT,+A%3E)
- [`Default for std::iter::Chain`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Chain.html)
- [`Default for std::iter::Cloned`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Cloned.html)
- [`Default for std::iter::Copied`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Copied.html)
- [`Default for std::iter::Enumerate`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Enumerate.html)
- [`Default for std::iter::Flatten`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Flatten.html)
- [`Default for std::iter::Fuse`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Fuse.html)
- [`Default for std::iter::Rev`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Rev.html)
- [`Default for std::slice::Iter`]
  (https://doc.rust-lang.org/stable/std/slice/struct.Iter.html)
- [`Default for std::slice::IterMut`]
  (https://doc.rust-lang.org/stable/std/slice/struct.IterMut.html)
- [`Rc::into_inner`]
  (https://doc.rust-lang.org/stable/alloc/rc/struct.Rc.html#method.into_inner)
- [`Arc::into_inner`]
  (https://doc.rust-lang.org/stable/alloc/sync/struct.Arc.html#method.into_inner)
- [`std::cell::OnceCell`]
  (https://doc.rust-lang.org/stable/std/cell/struct.OnceCell.html)
- [`Option::is_some_and`]
  (https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.is_some_and)
- [`NonNull::slice_from_raw_parts`]
  (https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.slice_from_raw_parts)
- [`Result::is_ok_and`]
  (https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.is_ok_and)
- [`Result::is_err_and`]
  (https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.is_err_and)
- [`std::sync::atomic::Atomic*::as_ptr`]
  (https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicU8.html#method.as_ptr)
- [`std::io::IsTerminal`]
  (https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html)
- [`std::os::linux::net::SocketAddrExt`]
  (https://doc.rust-lang.org/stable/std/os/linux/net/trait.SocketAddrExt.html)
- [`std::os::unix::net::UnixDatagram::bind_addr`]
  (https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.bind_addr)
- [`std::os::unix::net::UnixDatagram::connect_addr`]
  (https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.connect_addr)
- [`std::os::unix::net::UnixDatagram::send_to_addr`]
  (https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.send_to_addr)
- [`std::os::unix::net::UnixListener::bind_addr`]
  (https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixListener.html#method.bind_addr)
- [`std::path::Path::as_mut_os_str`]
  (https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.as_mut_os_str)
- [`std::sync::OnceLock`]
  (https://doc.rust-lang.org/stable/std/sync/struct.OnceLock.html)

Cargo
-----

- [Add `CARGO_PKG_README`]
  (rust-lang/cargo#11645)
- [Make `sparse` the default protocol for crates.io]
  (rust-lang/cargo#11791)
- [Accurately show status when downgrading dependencies]
  (rust-lang/cargo#11839)
- [Use registry.default for login/logout]
  (rust-lang/cargo#11949)
- [Stabilize `cargo logout`]
  (rust-lang/cargo#11950)

Misc
----

- [Stabilize rustdoc `--test-run-directory`]
  (rust-lang/rust#103682)

Compatibility Notes
-------------------

- [Prevent stable `libtest` from supporting `-Zunstable-options`]
  (rust-lang/rust#109044)
- [Perform const and unsafe checking for expressions in `let _ =
  expr` position.]
  (rust-lang/rust#102256)
- [WebAssembly targets enable `sign-ext` and `mutable-globals`
  features in codegen]
  (rust-lang/rust#109807)
  This may cause incompatibility with older execution environments.
- [Insert alignment checks for pointer dereferences as debug assertions]
  (rust-lang/rust#98112)
  This catches undefined behavior at runtime, and may cause existing
  code to fail.

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Upgrade to LLVM 16]
  (rust-lang/rust#109474)
- [Use SipHash-1-3 instead of SipHash-2-4 for StableHasher]
  (rust-lang/rust#107925)
overvenus added a commit to overvenus/tikv that referenced this pull request Dec 22, 2023
* upgrade stable feature `return_position_impl_trait_in_trait`
* upgrade lazy_cell rust-lang/rust/pull/105587
* upgrade core_io_borrowed_buf rust-lang/rust/pull/117694
* fix return position lifetime annotation

Signed-off-by: Neil Shen <overvenus@gmail.com>
derenv added a commit to derenv/gtk4-nvidia-monitor-rust that referenced this pull request May 20, 2024
- Updated reuse copyright year
- Added clearer import headers
- Refactored to now import std::cell::OnceCell as it has been [merged into std](rust-lang/rust#105587)
- Refactored to now import std::sync::OncelLock as it has been [merged into std](rust-lang/rust#105587)
- Added glib::BorrowedObject import
- Refactored to import Value from glib::value as it now has its own module in glib
- Refactored to import Variant and FromVariant from glib::variant as it now has its own module in glib
- Refactored "properties()" and "signals()" functions to reflect OnceLock changes
- Refactored to import glib::signal::Propagation instead of glib::signal::Inhibit
- Removed now unused "_obj" parameter to "property()" and "set_property()" functions
- Refactored "constructed()" function to get "obj" reference via "self" instead of as a parameter
- Updated "parent_constructed()" call in "constructed()" function
- Removed deprecated "window" parameter from "close_request()" function
- Updated "close_request()" function to return a Propagation type
- Updated "parent_close_request()" call in "close_request()" function
- Updated "signals()" function to use requisite functions of Signal::builder instead of parameters

Updated src/mainwindow/mod.rs:
- Updated reuse copyright year
- Added clearer import headers
- Updated "new()" function to use "Object::builder::<MainWindow>().build()" instead of untyped "Obect::new()""

Signed-off-by: Deren Vural <35734401+derenv@users.noreply.github.com>
derenv added a commit to derenv/gtk4-nvidia-monitor-rust that referenced this pull request May 20, 2024
- Updated reuse copyright year
- Added clearer import headers
- Refactored to now import std::cell::OnceCell as it has been [merged into std](rust-lang/rust#105587)
- Refactored to now import std::sync::OncelLock as it has been [merged into std](rust-lang/rust#105587)
- Added glib::BorrowedObject import
- Refactored to import Value from glib::value as it now has its own module in glib
- Refactored to import Variant and FromVariant from glib::variant as it now has its own module in glib
- Refactored "properties()"function to reflect OnceLock changes
- Removed now unused "_obj" parameter to "property()" and "set_property()" functions
- Refactored to use glib::signal::Propagation instead of glib::signal::Inhibit
- Refactored "constructed()" function to get "obj" reference via "self" instead of as a parameter
- Updated "parent_constructed()" call in "constructed()" function
- Removed deprecated "window" parameter from "close_request()" function
- Updated "close_request()" function to return a Propagation type

Updated src/modificationwindow/mod.rs:
- Updated reuse copyright year
- Added clearer import headers
- Removed GString import
- Updated "new()" function to use "Object::builder::<ModificationWindow>().build()" instead of untyped "Obect::new()""
- Commented out "settings()" function
- Refactored "setup_widgets()" function to use self.imp().get_setting::<Vec<String>>() instead of getting GString directly

Signed-off-by: Deren Vural <35734401+derenv@users.noreply.github.com>
derenv added a commit to derenv/gtk4-nvidia-monitor-rust that referenced this pull request May 20, 2024
- Updated reuse copyright year
- Added clearer import headers
- Refactored to now import std::cell::OnceCell as it has been [merged into std](rust-lang/rust#105587)
- Refactored to now import std::sync::OncelLock as it has been [merged into std](rust-lang/rust#105587)
- Refactored to import Value from glib::value as it now has its own module in glib
- Refactored to import Variant and FromVariant from glib::variant as it now has its own module in glib
- Added glib::BorrowedObject import
- Refactored to use glib::signal::Propagation instead of glib::signal::Inhibit
- Refactored "properties()"function to reflect OnceLock changes
- Removed now unused "_obj" parameter to "property()" and "set_property()" functions
- Removed deprecated "window" parameter from "close_request()" function
- Updated "close_request()" function to return a Propagation type
- Updated "parent_close_request()" call in "close_request()" function
- Refactored "constructed()" function to get "obj" reference via "self" instead of as a parameter
- Updated "parent_constructed()" call in "constructed()" function

Updated src/settingswindow/mod.rs:
- Updated reuse copyright year
- Added clearer import headers
- Updated "new()" function to use "Object::builder::<SettingsWindow>().build()" instead of untyped "Obect::new()""

Signed-off-by: Deren Vural <35734401+derenv@users.noreply.github.com>
derenv added a commit to derenv/gtk4-nvidia-monitor-rust that referenced this pull request May 20, 2024
- Updated reuse copyright year
- Added clearer import headers
- Refactored to now import std::cell::OnceCell as it has been [merged into std](rust-lang/rust#105587)
- Refactored to now import std::sync::OncelLock as it has been [merged into std](rust-lang/rust#105587)
- Refactored to import Value and ToValue from glib::value as it now has its own module in glib
- Refactored to import Variant and FromVariant from glib::variant as it now has its own module in glib
- Added glib::ControlFlow::Continue import
- Updated "create_updater()" function to reflect glib::ControlFlow::Continue changes
- Removed an unsafe block of code from "create_updater()" function
- Refactored "constructed()" function to get "obj" reference via "self" instead of as a parameter
- Updated "parent_constructed()" call in "constructed()" function
- Refactored "properties()" and "signals()" functions to reflect OnceLock changes
- Removed now unused "_obj" parameter to "property()" and "set_property()" functions

Updated src/gpu_page/mod.rs:
- Updated reuse copyright year
- Added clearer import headers
- Updated "new()" function to use "Object::builder::<GpuPage>().build()" instead of untyped "Obect::new()""

Signed-off-by: Deren Vural <35734401+derenv@users.noreply.github.com>
derenv added a commit to derenv/gtk4-nvidia-monitor-rust that referenced this pull request May 20, 2024
- Updated reuse copyright year
- Added clearer import headers
- Refactored to now import std::sync::OncelLock as it has been [merged into std](rust-lang/rust#105587)
- Refactored "properties()" function to reflect OnceLock changes
- Refactored to import Value from glib::value as it now has its own module in glib
- Removed now unused "_obj" parameter to "property()" and "set_property()" functions

Updated src/custom_button/mod.rs:
- Updated reuse copyright year
- Added clearer import headers
- Updated "new()" function to use "Object::builder::<CustomButton>().build()" instead of untyped "Obect::new()""
- Commented out "with_label()" function as this seems to be deprecated

Signed-off-by: Deren Vural <35734401+derenv@users.noreply.github.com>
derenv added a commit to derenv/gtk4-nvidia-monitor-rust that referenced this pull request May 20, 2024
- Updated reuse copyright year
- Added clearer import headers
- Refactored to now import std::cell::OnceCell as it has been [merged into std](rust-lang/rust#105587)
- Refactored to now import std::sync::OncelLock as it has been [merged into std](rust-lang/rust#105587)
- Refactored to import Value from glib::value as it now has its own module in glib
- Refactored to import FromVariant from glib::variant as it now has its own module in glib
- Refactored "constructed()" function to get "obj" reference via "self" instead of as a parameter
- Updated "parent_constructed()" call in "constructed()" function
- Refactored "properties()"function to reflect OnceLock changes
- Removed now unused "_obj" parameter to "property()" and "set_property()" functions

Updated src/formatter/mod.rs:
- Updated reuse copyright year
- Added clearer import headers
- Updated "new()" function to use "Object::builder::<Formatter>().build()" instead of untyped "Obect::new()""

Signed-off-by: Deren Vural <35734401+derenv@users.noreply.github.com>
derenv added a commit to derenv/gtk4-nvidia-monitor-rust that referenced this pull request May 20, 2024
- Updated reuse copyright year
- Added clearer import headers
- Refactored to now import std::sync::OncelLock as it has been [merged into std](rust-lang/rust#105587)
- Refactored to import Value from glib::value as it now has its own module in glib
- Refactored "properties()" function to reflect OnceLock changes
- Removed now unused "_obj" parameter to "property()" and "set_property()" functions

Updated src/processor/mod.rs:
- Updated reuse copyright year
- Added clearer import headers
- Updated "new()" function to use "Object::builder::<Processor>().build()" instead of untyped "Obect::new()""

Signed-off-by: Deren Vural <35734401+derenv@users.noreply.github.com>
derenv added a commit to derenv/gtk4-nvidia-monitor-rust that referenced this pull request May 20, 2024
- Updated reuse copyright year
- Added clearer import headers
- Refactored to now import std::sync::OncelLock as it has been [merged into std](rust-lang/rust#105587)
- Refactored to import Value and ToValue from glib::value as it now has its own module in glib
- Refactored "properties()" functions to reflect OnceLock changes
- Removed now unused "_obj" parameter to "property()" and "set_property()" functions

Updated src/property/mod.rs:
- Updated reuse copyright year
- Added clearer import headers
- Added import of FromValue from glib::value
- Updated "new()" function to use "Object::builder::<Property>().build()" instead of untyped "Obect::new()""
- Commented out "update_value()" function as it is unused

Signed-off-by: Deren Vural <35734401+derenv@users.noreply.github.com>
derenv added a commit to derenv/gtk4-nvidia-monitor-rust that referenced this pull request May 20, 2024
- Updated reuse copyright year
- Added clearer import headers
- Refactored to now import std::sync::OncelLock as it has been [merged into std](rust-lang/rust#105587)
- Added import of Value from glib::value
- Refactored "properties()" function to reflect OnceLock changes
- Removed now unused "_obj" parameter to "property()" and "set_property()" functions

Updated src/provider/mod.rs:
- Updated reuse copyright year
- Added clearer import headers
- Updated "new()" function to use "Object::builder::<Provider>().build()" instead of untyped "Obect::new()""

Signed-off-by: Deren Vural <35734401+derenv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. merged-by-bors This PR was explicitly merged by bors. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.