Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1e8ed90

Browse files
committedNov 3, 2024
Auto merge of rust-lang#132479 - compiler-errors:fx-feat-yeet, r=fee1-dead
Yeet the `effects` feature, move it onto `const_trait_impl` This PR merges the `effects` feature into the `const_trait_impl` feature. There's really no need to have two feature gates for one feature. After this PR, if `const_trait_impl` **is** enabled: * Users can use and define const traits * `HostEffect` const conditions will be enforced on the HIR * We re-check the predicates in MIR just to make sure that we don't "leak" anything during MIR lowering And if `const_trait_impl` **is not** enabled: * Users cannot use nor define const traits * `HostEffect` const conditions are not enforced on the HIR * We will raise a const validation error if we call a function that has any const conditions (i.e. const traits and functions with any `~const` in their where clasues) This should be the last step for us to be able to enable const traits in the standard library. We still need to re-constify `Drop` and `Destruct` and stuff for const traits to be particularly *useful* for some cases, but this is a good step :D r? fee1-dead cc `@rust-lang/project-const-traits`
2 parents ed4f110 + 9a3b7c0 commit 1e8ed90

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed
 

‎core/src/ffi/c_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ impl CStr {
510510
#[inline]
511511
#[must_use]
512512
const fn as_non_null_ptr(&self) -> NonNull<c_char> {
513-
// FIXME(effects) replace with `NonNull::from`
513+
// FIXME(const_trait_impl) replace with `NonNull::from`
514514
// SAFETY: a reference is never null
515515
unsafe { NonNull::new_unchecked(&self.inner as *const [c_char] as *mut [c_char]) }
516516
.as_non_null_ptr()

‎core/src/ops/drop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
/// [nomicon]: ../../nomicon/phantom-data.html#an-exception-the-special-case-of-the-standard-library-and-its-unstable-may_dangle
204204
#[lang = "drop"]
205205
#[stable(feature = "rust1", since = "1.0.0")]
206-
// FIXME(effects) #[const_trait]
206+
// FIXME(const_trait_impl) #[const_trait]
207207
pub trait Drop {
208208
/// Executes the destructor for this type.
209209
///

‎core/src/ops/function.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ use crate::marker::Tuple;
7272
)]
7373
#[fundamental] // so that regex can rely that `&str: !FnMut`
7474
#[must_use = "closures are lazy and do nothing unless called"]
75-
// FIXME(effects) #[const_trait]
75+
// FIXME(const_trait_impl) #[const_trait]
7676
pub trait Fn<Args: Tuple>: FnMut<Args> {
7777
/// Performs the call operation.
7878
#[unstable(feature = "fn_traits", issue = "29625")]
@@ -159,7 +159,7 @@ pub trait Fn<Args: Tuple>: FnMut<Args> {
159159
)]
160160
#[fundamental] // so that regex can rely that `&str: !FnMut`
161161
#[must_use = "closures are lazy and do nothing unless called"]
162-
// FIXME(effects) #[const_trait]
162+
// FIXME(const_trait_impl) #[const_trait]
163163
pub trait FnMut<Args: Tuple>: FnOnce<Args> {
164164
/// Performs the call operation.
165165
#[unstable(feature = "fn_traits", issue = "29625")]
@@ -238,7 +238,7 @@ pub trait FnMut<Args: Tuple>: FnOnce<Args> {
238238
)]
239239
#[fundamental] // so that regex can rely that `&str: !FnMut`
240240
#[must_use = "closures are lazy and do nothing unless called"]
241-
// FIXME(effects) #[const_trait]
241+
// FIXME(const_trait_impl) #[const_trait]
242242
pub trait FnOnce<Args: Tuple> {
243243
/// The returned type after the call operator is used.
244244
#[lang = "fn_once_output"]

‎core/src/slice/sort/shared/smallsort.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl<T: FreezeMarker> UnstableSmallSortTypeImpl for T {
102102
}
103103
}
104104

105-
/// FIXME(effects) use original ipnsort approach with choose_unstable_small_sort,
105+
/// FIXME(const_trait_impl) use original ipnsort approach with choose_unstable_small_sort,
106106
/// as found here <https://github.com/Voultapher/sort-research-rs/blob/438fad5d0495f65d4b72aa87f0b62fc96611dff3/ipnsort/src/smallsort.rs#L83C10-L83C36>.
107107
pub(crate) trait UnstableSmallSortFreezeTypeImpl: Sized + FreezeMarker {
108108
fn small_sort_threshold() -> usize;

0 commit comments

Comments
 (0)
Failed to load comments.