Skip to content
Closed
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
make const_alloc_layout feature gate only about functions that are al…
…ready stable

the rest has their constness guarded by their usual feature gate
  • Loading branch information
RalfJung committed Nov 1, 2024
commit c9e77e87762ce57ac3d1e8e70bf750fef75a9af5
11 changes: 5 additions & 6 deletions library/core/src/alloc/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl Layout {
/// [trait object]: ../../book/ch17-02-trait-objects.html
/// [extern type]: ../../unstable-book/language-features/extern-types.html
#[unstable(feature = "layout_for_ptr", issue = "69835")]
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
#[rustc_const_unstable(feature = "layout_for_ptr", issue = "69835")]
#[must_use]
pub const unsafe fn for_value_raw<T: ?Sized>(t: *const T) -> Self {
// SAFETY: we pass along the prerequisites of these functions to the caller
Expand All @@ -232,7 +232,6 @@ impl Layout {
/// sentinel value. Types that lazily allocate must track initialization by
/// some other means.
#[unstable(feature = "alloc_layout_extra", issue = "55724")]
#[rustc_const_unstable(feature = "alloc_layout_extra", issue = "55724")]
#[must_use]
#[inline]
pub const fn dangling(&self) -> NonNull<u8> {
Expand All @@ -256,6 +255,7 @@ impl Layout {
/// `align` violates the conditions listed in [`Layout::from_size_align`].
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
#[inline]
pub const fn align_to(&self, align: usize) -> Result<Self, LayoutError> {
if let Some(align) = Alignment::new(align) {
Expand All @@ -282,7 +282,6 @@ impl Layout {
/// address for the whole allocated block of memory. One way to
/// satisfy this constraint is to ensure `align <= self.align()`.
#[unstable(feature = "alloc_layout_extra", issue = "55724")]
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
#[must_use = "this returns the padding needed, \
without modifying the `Layout`"]
#[inline]
Expand Down Expand Up @@ -332,6 +331,7 @@ impl Layout {
/// to the layout's current size.
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
#[must_use = "this returns a new `Layout`, \
without modifying the original"]
#[inline]
Expand Down Expand Up @@ -374,7 +374,6 @@ impl Layout {
/// assert_eq!(repeated, (Layout::from_size_align(24, 4).unwrap(), 8));
/// ```
#[unstable(feature = "alloc_layout_extra", issue = "55724")]
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
#[inline]
pub const fn repeat(&self, n: usize) -> Result<(Self, usize), LayoutError> {
let padded = self.pad_to_align();
Expand Down Expand Up @@ -432,6 +431,7 @@ impl Layout {
/// ```
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
#[inline]
pub const fn extend(&self, next: Self) -> Result<(Self, usize), LayoutError> {
let new_align = Alignment::max(self.align, next.align);
Expand Down Expand Up @@ -463,7 +463,6 @@ impl Layout {
///
/// On arithmetic overflow, returns `LayoutError`.
#[unstable(feature = "alloc_layout_extra", issue = "55724")]
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
#[inline]
pub const fn repeat_packed(&self, n: usize) -> Result<Self, LayoutError> {
if let Some(size) = self.size.checked_mul(n) {
Expand All @@ -481,7 +480,6 @@ impl Layout {
///
/// On arithmetic overflow, returns `LayoutError`.
#[unstable(feature = "alloc_layout_extra", issue = "55724")]
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
#[inline]
pub const fn extend_packed(&self, next: Self) -> Result<Self, LayoutError> {
// SAFETY: each `size` is at most `isize::MAX == usize::MAX/2`, so the
Expand All @@ -497,6 +495,7 @@ impl Layout {
/// `isize::MAX`, returns `LayoutError`.
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
#[inline]
pub const fn array<T>(n: usize) -> Result<Self, LayoutError> {
// Reduce the amount of code we need to monomorphize per `T`.
Expand Down
Loading