commit | 5f17779a03746af581d8867449b1627404d8cd3f | [log] [tgz] |
---|---|---|
author | Trevor Gross <t.gross35@gmail.com> | Wed May 28 10:28:07 2025 -0400 |
committer | GitHub <noreply@github.com> | Wed May 28 10:28:07 2025 -0400 |
tree | 3d3fd8a0cf752df68254482bae70eb5d9ce4b2e2 | |
parent | 77101febcc9662a076ff43887497cd5b30674d93 [diff] | |
parent | 20589bd6050ff9596348c751231ac84b7538adb4 [diff] |
Rollup merge of #140369 - jplatte:mutex-rwlock-data-ptr, r=Amanieu Add data_ptr method to Mutex and RwLock Implementation of https://github.com/rust-lang/rust/issues/140368 / https://github.com/rust-lang/libs-team/issues/531. I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course. Unresolved questions: - Return a `LockResult` or not? - Return `*mut T` like existing APIs (`Cell::as_ptr` / `MaybeUninit::as[_mut]_ptr` / `Vec::as_ptr` / ...) or be more precise and return `NonNull<T>`?
Website | Getting started | Learn | Documentation | Contributing
This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.
Performance: Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrated with other languages.
Reliability: Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time.
Productivity: Comprehensive documentation, a compiler committed to providing great diagnostics, and advanced tooling including package manager and build tool (Cargo), auto-formatter (rustfmt), linter (Clippy) and editor support (rust-analyzer).
Read “Installation” from The Book.
If you really want to install from source (though this is not recommended), see INSTALL.md.
See https://www.rust-lang.org/community for a list of chat platforms and forums.
See CONTRIBUTING.md.
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the “Rust Trademarks”).
If you want to use these names or brands, please read the Rust language trademark policy.
Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.