Skip to content

Commit a1d14c0

Browse files
authored
Rollup merge of rust-lang#84547 - RalfJung:max_const_fn, r=oli-obk
Get rid of is_min_const_fn This removes the last trace of the min_const_fn mechanism by making the unsafety checker agnostic about whether something is a min or "non-min" const fn. It seems this distinction was used to disallow some features inside `const fn`, but that is the responsibility of the const checker, not of the unsafety checker. No test seems to even notice this change in the unsafety checker so I guess we are good... r? `@oli-obk` Cc rust-lang#84510
2 parents 861a3df + e863b26 commit a1d14c0

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Diff for: alloc/src/raw_vec.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,11 @@ pub struct RawVec<T, A: Allocator = Global> {
5353
}
5454

5555
impl<T> RawVec<T, Global> {
56-
/// HACK(Centril): This exists because `#[unstable]` `const fn`s needn't conform
57-
/// to `min_const_fn` and so they cannot be called in `min_const_fn`s either.
56+
/// HACK(Centril): This exists because stable `const fn` can only call stable `const fn`, so
57+
/// they cannot call `Self::new()`.
5858
///
59-
/// If you change `RawVec<T>::new` or dependencies, please take care to not
60-
/// introduce anything that would truly violate `min_const_fn`.
61-
///
62-
/// NOTE: We could avoid this hack and check conformance with some
63-
/// `#[rustc_force_min_const_fn]` attribute which requires conformance
64-
/// with `min_const_fn` but does not necessarily allow calling it in
65-
/// `stable(...) const fn` / user code not enabling `foo` when
66-
/// `#[rustc_const_unstable(feature = "foo", issue = "01234")]` is present.
59+
/// If you change `RawVec<T>::new` or dependencies, please take care to not introduce anything
60+
/// that would truly const-call something unstable.
6761
pub const NEW: Self = Self::new();
6862

6963
/// Creates the biggest possible `RawVec` (on the system heap)

0 commit comments

Comments
 (0)