e0f8202ed5
Fully stabilize the following API, including const where applicable: impl <T> NonNull<T> { pub const unsafe fn offset(self, count: isize) -> Self; pub const unsafe fn add(self, count: usize) -> Self; pub const unsafe fn sub(self, count: usize) -> Self; pub const unsafe fn offset_from(self, origin: NonNull<T>) -> isize; pub const unsafe fn read(self) -> T; pub unsafe fn read_volatile(self) -> T; pub const unsafe fn read_unaligned(self) -> T; pub unsafe fn write_volatile(self, val: T); pub unsafe fn replace(self, src: T) -> T; } impl<T: ?Sized> NonNull<T> { pub const unsafe fn byte_offset(self, count: isize) -> Self; pub const unsafe fn byte_add(self, count: usize) -> Self; pub const unsafe fn byte_sub(self, count: usize) -> Self; pub const unsafe fn byte_offset_from<U: ?Sized>(self, origin: NonNull<U>) -> isize; pub unsafe fn drop_in_place(self); } Stabilize the following without const: impl <T> NonNull<T> { // const under `const_intrinsic_copy` pub const unsafe fn copy_to(self, dest: NonNull<T>, count: usize); pub const unsafe fn copy_to_nonoverlapping(self, dest: NonNull<T>, count: usize); pub const unsafe fn copy_from(self, src: NonNull<T>, count: usize); pub const unsafe fn copy_from_nonoverlapping(self, src: NonNull<T>, count: usize); // const under `const_ptr_write` pub const unsafe fn write(self, val: T); pub const unsafe fn write_bytes(self, val: u8, count: usize); pub const unsafe fn write_unaligned(self, val: T); // const under `const_swap` pub const unsafe fn swap(self, with: NonNull<T>); // const under `const_align_offset` pub const fn align_offset(self, align: usize) -> usize; // const under `const_pointer_is_aligned` pub const fn is_aligned(self) -> bool; } Left the following unstable: impl <T> NonNull<T> { // moved gate to `ptr_sub_ptr` pub const unsafe fn sub_ptr(self, subtracted: NonNull<T>) -> usize; } impl <T: ?Sized> NonNull<T> { // moved gate to `pointer_is_aligned_to` pub const fn is_aligned_to(self, align: usize) -> bool; } Fixes: https://github.com/rust-lang/rust/issues/117691 |
||
---|---|---|
.github | ||
.reuse | ||
compiler | ||
library | ||
LICENSES | ||
src | ||
tests | ||
.editorconfig | ||
.git-blame-ignore-revs | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.mailmap | ||
Cargo.lock | ||
Cargo.toml | ||
CODE_OF_CONDUCT.md | ||
config.example.toml | ||
configure | ||
CONTRIBUTING.md | ||
COPYRIGHT | ||
INSTALL.md | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
RELEASES.md | ||
rust-bors.toml | ||
rustfmt.toml | ||
triagebot.toml | ||
x | ||
x.ps1 | ||
x.py |
This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.
Why Rust?
-
Performance: Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrate 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).
Quick Start
Read "Installation" from The Book.
Installing from Source
If you really want to install from source (though this is not recommended), see INSTALL.md.
Getting Help
See https://www.rust-lang.org/community for a list of chat platforms and forums.
Contributing
See CONTRIBUTING.md.
License
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.
Trademark
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 media guide.
Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.