Skip to content

Rollup of 14 pull requests #132470

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 35 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d7e6074
style-guide: Only use the new binop heuristic for assignments
joshtriplett Oct 30, 2024
ce3e14a
Remove support for `-Zprofile` (gcov-style coverage instrumentation)
Zalathar Oct 17, 2024
dd651be
update offset_of! docs to reflect the stablization of nesting
lolbinarycat Oct 31, 2024
fc67203
use semantic line break
lolbinarycat Oct 31, 2024
588c7a9
nit: stop using TypeckRootCtxt
compiler-errors Oct 31, 2024
41966e7
Suggest annotations for never type fallback
compiler-errors Oct 31, 2024
ea4fb7c
Suggest adding self type to method
compiler-errors Oct 31, 2024
c930bba
And locals too
compiler-errors Oct 31, 2024
df6f584
And also suggest for qpaths
compiler-errors Oct 31, 2024
b4248ae
nits
compiler-errors Nov 1, 2024
3afbe4f
Add `f16` and `f128` to `invalid_nan_comparison`
tgross35 Nov 1, 2024
b6a49d8
Remove unncessary option for default rust-analyzer setting
chenyukang Nov 1, 2024
5342eb0
Add missing backtick
chengehe Nov 1, 2024
7603385
Show actual MIR when MIR building forgot to terminate block
bjorn3 Oct 7, 2024
506812d
remove some unnecessary rustc_allow_const_fn_unstable
RalfJung Nov 1, 2024
901b340
unchecked_shifts, unchecked_neg are safe-to-const-expose-on-stable, s…
RalfJung Nov 1, 2024
96e7eaf
Move remaining inline assembly test files into asm directory
taiki-e Nov 1, 2024
c9e77e8
make const_alloc_layout feature gate only about functions that are al…
RalfJung Nov 1, 2024
aba2088
feat(byte_sub_ptr): add ptr::byte_sub_ptr
Gankra Mar 3, 2024
c388655
offset_from / sub_ptr docs: emphasize that pointers must be in the sa…
RalfJung Nov 1, 2024
a8d4d23
rustdoc: Directly use rustc_abi instead of reexports
workingjubilee Nov 1, 2024
526c67f
Rollup merge of #131829 - Zalathar:goodbye-zprofile, r=chenyukang
GuillaumeGomez Nov 1, 2024
348d280
Rollup merge of #132369 - joshtriplett:style-guide-binop-heuristic-as…
GuillaumeGomez Nov 1, 2024
e31a5ca
Rollup merge of #132383 - compiler-errors:never-type-fallback-sugg, r…
GuillaumeGomez Nov 1, 2024
5f0568b
Rollup merge of #132413 - lolbinarycat:offset_of_nested-docs, r=worki…
GuillaumeGomez Nov 1, 2024
c794207
Rollup merge of #132438 - chenyukang:yukang-fix-analyzer_settings, r=…
GuillaumeGomez Nov 1, 2024
2896483
Rollup merge of #132439 - tgross35:f16-f128-nan-lint, r=jieyouxu
GuillaumeGomez Nov 1, 2024
93fb6ef
Rollup merge of #132444 - workingjubilee:rustdoc-my-abi, r=GuillaumeG…
GuillaumeGomez Nov 1, 2024
8366ecc
Rollup merge of #132445 - RalfJung:const-unchecked-shifts, r=tgross35
GuillaumeGomez Nov 1, 2024
e9e7aa8
Rollup merge of #132448 - chengehe:master, r=Noratrieb
GuillaumeGomez Nov 1, 2024
7bfdc3d
Rollup merge of #132450 - bjorn3:better_mir_errors, r=jieyouxu
GuillaumeGomez Nov 1, 2024
5f8d7e8
Rollup merge of #132451 - RalfJung:less-rustc_allow_const_fn_unstable…
GuillaumeGomez Nov 1, 2024
d536609
Rollup merge of #132455 - RalfJung:const_alloc_layout, r=dtolnay
GuillaumeGomez Nov 1, 2024
81c6943
Rollup merge of #132456 - taiki-e:test-asm-dir, r=jieyouxu
GuillaumeGomez Nov 1, 2024
305ca05
Rollup merge of #132459 - RalfJung:byte_sub_ptr, r=scottmcm
GuillaumeGomez Nov 1, 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
Prev Previous commit
Next Next commit
offset_from / sub_ptr docs: emphasize that pointers must be in the sa…
…me allocation
  • Loading branch information
RalfJung committed Nov 1, 2024
commit c38865502eae3cdd930669d68295b30276903d37
8 changes: 4 additions & 4 deletions library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ impl<T: ?Sized> *const T {
intrinsics::ptr_mask(self.cast::<()>(), mask).with_metadata_of(self)
}

/// Calculates the distance between two pointers. The returned value is in
/// Calculates the distance between two pointers within the same allocation. The returned value is in
/// units of T: the distance in bytes divided by `mem::size_of::<T>()`.
///
/// This is equivalent to `(self as isize - origin as isize) / (mem::size_of::<T>() as isize)`,
Expand Down Expand Up @@ -677,7 +677,7 @@ impl<T: ?Sized> *const T {
unsafe { intrinsics::ptr_offset_from(self, origin) }
}

/// Calculates the distance between two pointers. The returned value is in
/// Calculates the distance between two pointers within the same allocation. The returned value is in
/// units of **bytes**.
///
/// This is purely a convenience for casting to a `u8` pointer and
Expand All @@ -695,7 +695,7 @@ impl<T: ?Sized> *const T {
unsafe { self.cast::<u8>().offset_from(origin.cast::<u8>()) }
}

/// Calculates the distance between two pointers, *where it's known that
/// Calculates the distance between two pointers within the same allocation, *where it's known that
/// `self` is equal to or greater than `origin`*. The returned value is in
/// units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
///
Expand Down Expand Up @@ -790,7 +790,7 @@ impl<T: ?Sized> *const T {
unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
}

/// Calculates the distance between two pointers, *where it's known that
/// Calculates the distance between two pointers within the same allocation, *where it's known that
/// `self` is equal to or greater than `origin`*. The returned value is in
/// units of **bytes**.
///
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ impl<T: ?Sized> *mut T {
(self as *const T).guaranteed_ne(other as _)
}

/// Calculates the distance between two pointers. The returned value is in
/// Calculates the distance between two pointers within the same allocation. The returned value is in
/// units of T: the distance in bytes divided by `mem::size_of::<T>()`.
///
/// This is equivalent to `(self as isize - origin as isize) / (mem::size_of::<T>() as isize)`,
Expand Down Expand Up @@ -839,7 +839,7 @@ impl<T: ?Sized> *mut T {
unsafe { (self as *const T).offset_from(origin) }
}

/// Calculates the distance between two pointers. The returned value is in
/// Calculates the distance between two pointers within the same allocation. The returned value is in
/// units of **bytes**.
///
/// This is purely a convenience for casting to a `u8` pointer and
Expand All @@ -857,7 +857,7 @@ impl<T: ?Sized> *mut T {
unsafe { self.cast::<u8>().offset_from(origin.cast::<u8>()) }
}

/// Calculates the distance between two pointers, *where it's known that
/// Calculates the distance between two pointers within the same allocation, *where it's known that
/// `self` is equal to or greater than `origin`*. The returned value is in
/// units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
///
Expand Down Expand Up @@ -930,7 +930,7 @@ impl<T: ?Sized> *mut T {
unsafe { (self as *const T).sub_ptr(origin) }
}

/// Calculates the distance between two pointers, *where it's known that
/// Calculates the distance between two pointers within the same allocation, *where it's known that
/// `self` is equal to or greater than `origin`*. The returned value is in
/// units of **bytes**.
///
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/ptr/non_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ impl<T: ?Sized> NonNull<T> {
unsafe { NonNull { pointer: self.pointer.byte_sub(count) } }
}

/// Calculates the distance between two pointers. The returned value is in
/// Calculates the distance between two pointers within the same allocation. The returned value is in
/// units of T: the distance in bytes divided by `mem::size_of::<T>()`.
///
/// This is equivalent to `(self as isize - origin as isize) / (mem::size_of::<T>() as isize)`,
Expand Down Expand Up @@ -773,7 +773,7 @@ impl<T: ?Sized> NonNull<T> {
unsafe { self.pointer.offset_from(origin.pointer) }
}

/// Calculates the distance between two pointers. The returned value is in
/// Calculates the distance between two pointers within the same allocation. The returned value is in
/// units of **bytes**.
///
/// This is purely a convenience for casting to a `u8` pointer and
Expand All @@ -793,7 +793,7 @@ impl<T: ?Sized> NonNull<T> {

// N.B. `wrapping_offset``, `wrapping_add`, etc are not implemented because they can wrap to null

/// Calculates the distance between two pointers, *where it's known that
/// Calculates the distance between two pointers within the same allocation, *where it's known that
/// `self` is equal to or greater than `origin`*. The returned value is in
/// units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
///
Expand Down Expand Up @@ -866,7 +866,7 @@ impl<T: ?Sized> NonNull<T> {
unsafe { self.pointer.sub_ptr(subtracted.pointer) }
}

/// Calculates the distance between two pointers, *where it's known that
/// Calculates the distance between two pointers within the same allocation, *where it's known that
/// `self` is equal to or greater than `origin`*. The returned value is in
/// units of **bytes**.
///
Expand Down
Loading