Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a9f6fd1
x86-32 float return for 'Rust' ABI: treat all float types consistently
RalfJung Oct 18, 2024
8f2273e
Fix #131471, range misleading field access
hirschenberger Oct 11, 2024
1617501
Mark unexpected variant res suggestion as having placeholders
compiler-errors Oct 18, 2024
588bfb4
std: uefi: Add basic Env variables
Ayush1325 Oct 15, 2024
753536a
std: uefi: Use common function for UEFI shell
Ayush1325 Oct 16, 2024
be984c1
Update `use` keyword docs to describe precise capturing
printfn Oct 18, 2024
3cf8a61
rustdoc: Switch from FxHash to sha256 for static file hashing.
aDotInTheVoid Oct 18, 2024
65458ae
bootstrap: allow setting `--jobs` in config.toml
jieyouxu Oct 17, 2024
eea74be
interpret errors: add map_err_kind, rename InterpError -> InterpError…
RalfJung Oct 19, 2024
1b11ba8
zero-sized accesses are fine on null pointers
RalfJung Oct 19, 2024
98e90f4
Rollup merge of #127462 - Ayush1325:uefi-env, r=joboet
matthiaskrgr Oct 19, 2024
7810951
Rollup merge of #131537 - hirschenberger:master, r=compiler-errors
matthiaskrgr Oct 19, 2024
85be3b2
Rollup merge of #131838 - jieyouxu:boopjob, r=onur-ozkan
matthiaskrgr Oct 19, 2024
fb48c7d
Rollup merge of #131871 - RalfJung:x86-32-float, r=workingjubilee
matthiaskrgr Oct 19, 2024
ec4042d
Rollup merge of #131890 - printfn:precise-capturing-docs, r=traviscross
matthiaskrgr Oct 19, 2024
37a7e48
Rollup merge of #131899 - compiler-errors:placeholder, r=lqd
matthiaskrgr Oct 19, 2024
9f162e1
Rollup merge of #131908 - aDotInTheVoid:rustdoc-gamer-hashing, r=notr…
matthiaskrgr Oct 19, 2024
511273f
Rollup merge of #131916 - RalfJung:interpret-err, r=jieyouxu
matthiaskrgr Oct 19, 2024
ce2c3c7
Rollup merge of #131919 - RalfJung:zero-sized-accesses, r=jhpratt
matthiaskrgr Oct 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3138,7 +3138,7 @@ pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + ?Sized, M>(_ptr: *cons
/// [violate memory safety][read-ownership].
///
/// Note that even if the effectively copied size (`count * size_of::<T>()`) is
/// `0`, the pointers must be non-null and properly aligned.
/// `0`, the pointers must be properly aligned.
///
/// [`read`]: crate::ptr::read
/// [read-ownership]: crate::ptr::read#ownership-of-the-returned-value
Expand Down Expand Up @@ -3261,7 +3261,7 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
/// [violate memory safety][read-ownership].
///
/// Note that even if the effectively copied size (`count * size_of::<T>()`) is
/// `0`, the pointers must be non-null and properly aligned.
/// `0`, the pointers must be properly aligned.
///
/// [`read`]: crate::ptr::read
/// [read-ownership]: crate::ptr::read#ownership-of-the-returned-value
Expand Down Expand Up @@ -3342,7 +3342,7 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
/// * `dst` must be properly aligned.
///
/// Note that even if the effectively copied size (`count * size_of::<T>()`) is
/// `0`, the pointer must be non-null and properly aligned.
/// `0`, the pointer must be properly aligned.
///
/// Additionally, note that changing `*dst` in this way can easily lead to undefined behavior (UB)
/// later if the written bytes are not a valid representation of some `T`. For instance, the
Expand Down
9 changes: 6 additions & 3 deletions library/core/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,11 @@ impl () {}
///
/// *[See also the `std::ptr` module](ptr).*
///
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
/// Raw pointers can be unaligned or [`null`]. However, when a raw pointer is
/// dereferenced (using the `*` operator), it must be non-null and aligned.
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns. Raw pointers
/// can be out-of-bounds, unaligned, or [`null`]. However, when loading from or storing to a raw
/// pointer, it must be [valid] for the given access and aligned. When using a field expression,
/// tuple index expression, or array/slice index expression on a raw pointer, it follows the rules
/// of [in-bounds pointer arithmetic][`offset`].
///
/// Storing through a raw pointer using `*ptr = data` calls `drop` on the old value, so
/// [`write`] must be used if the type has drop glue and memory is not already
Expand Down Expand Up @@ -613,6 +615,7 @@ impl () {}
/// [`offset`]: pointer::offset
/// [`into_raw`]: ../std/boxed/struct.Box.html#method.into_raw
/// [`write`]: ptr::write
/// [valid]: ptr#safety
#[stable(feature = "rust1", since = "1.0.0")]
mod prim_pointer {}

Expand Down
14 changes: 7 additions & 7 deletions library/core/src/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
///
/// * Both `x` and `y` must be properly aligned.
///
/// Note that even if `T` has size `0`, the pointers must be non-null and properly aligned.
/// Note that even if `T` has size `0`, the pointers must be properly aligned.
///
/// [valid]: self#safety
///
Expand Down Expand Up @@ -1110,7 +1110,7 @@ pub const unsafe fn swap<T>(x: *mut T, y: *mut T) {
/// beginning at `y` with the same size.
///
/// Note that even if the effectively copied size (`count * size_of::<T>()`) is `0`,
/// the pointers must be non-null and properly aligned.
/// the pointers must be properly aligned.
///
/// [valid]: self#safety
///
Expand Down Expand Up @@ -1243,7 +1243,7 @@ const unsafe fn swap_nonoverlapping_simple_untyped<T>(x: *mut T, y: *mut T, coun
///
/// * `dst` must point to a properly initialized value of type `T`.
///
/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned.
/// Note that even if `T` has size `0`, the pointer must be properly aligned.
///
/// [valid]: self#safety
///
Expand Down Expand Up @@ -1300,7 +1300,7 @@ pub const unsafe fn replace<T>(dst: *mut T, src: T) -> T {
///
/// * `src` must point to a properly initialized value of type `T`.
///
/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned.
/// Note that even if `T` has size `0`, the pointer must be properly aligned.
///
/// # Examples
///
Expand Down Expand Up @@ -1555,7 +1555,7 @@ pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
/// * `dst` must be properly aligned. Use [`write_unaligned`] if this is not the
/// case.
///
/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned.
/// Note that even if `T` has size `0`, the pointer must be properly aligned.
///
/// [valid]: self#safety
///
Expand Down Expand Up @@ -1774,7 +1774,7 @@ pub const unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
/// However, storing non-[`Copy`] types in volatile memory is almost certainly
/// incorrect.
///
/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned.
/// Note that even if `T` has size `0`, the pointer must be properly aligned.
///
/// [valid]: self#safety
/// [read-ownership]: read#ownership-of-the-returned-value
Expand Down Expand Up @@ -1853,7 +1853,7 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T {
///
/// * `dst` must be properly aligned.
///
/// Note that even if `T` has size `0`, the pointer must be non-null and properly aligned.
/// Note that even if `T` has size `0`, the pointer must be properly aligned.
///
/// [valid]: self#safety
///
Expand Down
Loading