diff options
| author | bors <bors@rust-lang.org> | 2024-11-03 19:41:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-11-03 19:41:46 +0000 |
| commit | b8c8287a229cd79604aa84c25e1235fc78cd5f2e (patch) | |
| tree | acfe9ecc81e736fd65eb874b781aa7c365e9c51b /compiler/rustc_const_eval/src/const_eval/machine.rs | |
| parent | e3a918ece026cec748fc64af5b4983095b46097e (diff) | |
| parent | 6b96103bf3b0746e443f9bb86b532be2c536113a (diff) | |
| download | rust-b8c8287a229cd79604aa84c25e1235fc78cd5f2e.tar.gz rust-b8c8287a229cd79604aa84c25e1235fc78cd5f2e.zip | |
Auto merge of #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`
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval/machine.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/machine.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index 5f0bc8539ee..977d25f359f 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -431,7 +431,7 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> { // sensitive check here. But we can at least rule out functions that are not const at // all. That said, we have to allow calling functions inside a trait marked with // #[const_trait]. These *are* const-checked! - // FIXME(effects): why does `is_const_fn` not classify them as const? + // FIXME(const_trait_impl): why does `is_const_fn` not classify them as const? if (!ecx.tcx.is_const_fn(def) && !ecx.tcx.is_const_default_method(def)) || ecx.tcx.has_attr(def, sym::rustc_do_not_const_check) { |
