Skip to content

Rollup of 13 pull requests #132462

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

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 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
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
f3f1593
coverage: Regression test for inlining into an uninstrumented crate
Zalathar 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
968e7aa
Rollup merge of #131829 - Zalathar:goodbye-zprofile, r=chenyukang
jieyouxu Nov 1, 2024
6f82947
Rollup merge of #132369 - joshtriplett:style-guide-binop-heuristic-as…
jieyouxu Nov 1, 2024
3806a9f
Rollup merge of #132383 - compiler-errors:never-type-fallback-sugg, r…
jieyouxu Nov 1, 2024
9125b51
Rollup merge of #132437 - Zalathar:inline-mixed-regression, r=jieyouxu
jieyouxu Nov 1, 2024
e9fa793
Rollup merge of #132438 - chenyukang:yukang-fix-analyzer_settings, r=…
jieyouxu Nov 1, 2024
52a9a1b
Rollup merge of #132439 - tgross35:f16-f128-nan-lint, r=jieyouxu
jieyouxu Nov 1, 2024
62a8997
Rollup merge of #132445 - RalfJung:const-unchecked-shifts, r=tgross35
jieyouxu Nov 1, 2024
c0765b3
Rollup merge of #132448 - chengehe:master, r=Noratrieb
jieyouxu Nov 1, 2024
dfc74b7
Rollup merge of #132450 - bjorn3:better_mir_errors, r=jieyouxu
jieyouxu Nov 1, 2024
b80eb4b
Rollup merge of #132451 - RalfJung:less-rustc_allow_const_fn_unstable…
jieyouxu Nov 1, 2024
9e0a3a7
Rollup merge of #132455 - RalfJung:const_alloc_layout, r=dtolnay
jieyouxu Nov 1, 2024
5ebccae
Rollup merge of #132456 - taiki-e:test-asm-dir, r=jieyouxu
jieyouxu Nov 1, 2024
824e227
Rollup merge of #132459 - RalfJung:byte_sub_ptr, r=scottmcm
jieyouxu 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
unchecked_shifts, unchecked_neg are safe-to-const-expose-on-stable, s…
…o we can get rid of a bunch of attributes
  • Loading branch information
RalfJung committed Nov 1, 2024
commit 901b340c1f5d208561d4261cc3ee634973b35326
16 changes: 7 additions & 9 deletions library/core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ macro_rules! int_impl {
)]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[rustc_const_unstable(feature = "unchecked_neg", issue = "85122")]
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "unchecked_neg", issue = "85122"))]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn unchecked_neg(self) -> Self {
Expand Down Expand Up @@ -1227,8 +1227,7 @@ macro_rules! int_impl {
/// ```
#[stable(feature = "wrapping", since = "1.7.0")]
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.47.0")]
// We could always go back to wrapping
#[rustc_allow_const_fn_unstable(unchecked_shifts)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_shifts))]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
Expand Down Expand Up @@ -1294,7 +1293,7 @@ macro_rules! int_impl {
)]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[rustc_const_unstable(feature = "unchecked_shifts", issue = "85122")]
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "unchecked_shifts", issue = "85122"))]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn unchecked_shl(self, rhs: u32) -> Self {
Expand Down Expand Up @@ -1353,8 +1352,7 @@ macro_rules! int_impl {
/// ```
#[stable(feature = "wrapping", since = "1.7.0")]
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.47.0")]
// We could always go back to wrapping
#[rustc_allow_const_fn_unstable(unchecked_shifts)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_shifts))]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
Expand Down Expand Up @@ -1420,7 +1418,7 @@ macro_rules! int_impl {
)]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[rustc_const_unstable(feature = "unchecked_shifts", issue = "85122")]
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "unchecked_shifts", issue = "85122"))]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn unchecked_shr(self, rhs: u32) -> Self {
Expand Down Expand Up @@ -2151,7 +2149,7 @@ macro_rules! int_impl {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
#[rustc_allow_const_fn_unstable(unchecked_shifts)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_shifts))]
pub const fn wrapping_shl(self, rhs: u32) -> Self {
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
// out of bounds
Expand Down Expand Up @@ -2181,7 +2179,7 @@ macro_rules! int_impl {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
#[rustc_allow_const_fn_unstable(unchecked_shifts)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_shifts))]
pub const fn wrapping_shr(self, rhs: u32) -> Self {
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
// out of bounds
Expand Down
14 changes: 6 additions & 8 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1416,8 +1416,7 @@ macro_rules! uint_impl {
/// ```
#[stable(feature = "wrapping", since = "1.7.0")]
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.47.0")]
// We could always go back to wrapping
#[rustc_allow_const_fn_unstable(unchecked_shifts)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_shifts))]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
Expand Down Expand Up @@ -1483,7 +1482,7 @@ macro_rules! uint_impl {
)]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[rustc_const_unstable(feature = "unchecked_shifts", issue = "85122")]
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "unchecked_shifts", issue = "85122"))]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn unchecked_shl(self, rhs: u32) -> Self {
Expand Down Expand Up @@ -1542,8 +1541,7 @@ macro_rules! uint_impl {
/// ```
#[stable(feature = "wrapping", since = "1.7.0")]
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.47.0")]
// We could always go back to wrapping
#[rustc_allow_const_fn_unstable(unchecked_shifts)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_shifts))]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
Expand Down Expand Up @@ -1609,7 +1607,7 @@ macro_rules! uint_impl {
)]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[rustc_const_unstable(feature = "unchecked_shifts", issue = "85122")]
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "unchecked_shifts", issue = "85122"))]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn unchecked_shr(self, rhs: u32) -> Self {
Expand Down Expand Up @@ -2132,7 +2130,7 @@ macro_rules! uint_impl {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
#[rustc_allow_const_fn_unstable(unchecked_shifts)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_shifts))]
pub const fn wrapping_shl(self, rhs: u32) -> Self {
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
// out of bounds
Expand Down Expand Up @@ -2165,7 +2163,7 @@ macro_rules! uint_impl {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
#[rustc_allow_const_fn_unstable(unchecked_shifts)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_shifts))]
pub const fn wrapping_shr(self, rhs: u32) -> Self {
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
// out of bounds
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ impl<T: ?Sized> *const T {
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
#[rustc_allow_const_fn_unstable(unchecked_neg)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_neg))]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn sub(self, count: usize) -> Self
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ impl<T: ?Sized> *mut T {
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
#[rustc_allow_const_fn_unstable(unchecked_neg)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_neg))]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn sub(self, count: usize) -> Self
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ptr/non_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ impl<T: ?Sized> NonNull<T> {
#[must_use = "returns a new pointer rather than modifying its argument"]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_allow_const_fn_unstable(unchecked_neg)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(unchecked_neg))]
pub const unsafe fn sub(self, count: usize) -> Self
where
T: Sized,
Expand Down
Loading