Skip to content

Commit b8c8287

Browse files
committed
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`
2 parents e3a918e + 6b96103 commit b8c8287

File tree

221 files changed

+370
-1025
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+370
-1025
lines changed

compiler/rustc_ast_passes/src/errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,8 @@ pub(crate) struct ConstBoundTraitObject {
594594
pub span: Span,
595595
}
596596

597-
// FIXME(effects): Consider making the note/reason the message of the diagnostic.
598-
// FIXME(effects): Provide structured suggestions (e.g., add `const` / `#[const_trait]` here).
597+
// FIXME(const_trait_impl): Consider making the note/reason the message of the diagnostic.
598+
// FIXME(const_trait_impl): Provide structured suggestions (e.g., add `const` / `#[const_trait]` here).
599599
#[derive(Diagnostic)]
600600
#[diag(ast_passes_tilde_const_disallowed)]
601601
pub(crate) struct TildeConstDisallowed {

compiler/rustc_const_eval/src/check_consts/check.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use rustc_mir_dataflow::Analysis;
2020
use rustc_mir_dataflow::impls::MaybeStorageLive;
2121
use rustc_mir_dataflow::storage::always_storage_live_locals;
2222
use rustc_span::{Span, Symbol, sym};
23-
use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
2423
use rustc_trait_selection::traits::{
2524
Obligation, ObligationCause, ObligationCauseCode, ObligationCtxt,
2625
};
@@ -419,13 +418,8 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
419418

420419
let errors = ocx.select_all_or_error();
421420
if !errors.is_empty() {
422-
// FIXME(effects): Soon this should be unconditionally delaying a bug.
423-
if matches!(call_source, CallSource::Normal) && tcx.features().effects() {
424-
tcx.dcx()
425-
.span_delayed_bug(call_span, "this should have reported a ~const error in HIR");
426-
} else {
427-
infcx.err_ctxt().report_fulfillment_errors(errors);
428-
}
421+
tcx.dcx()
422+
.span_delayed_bug(call_span, "this should have reported a ~const error in HIR");
429423
}
430424
}
431425
}
@@ -663,8 +657,9 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
663657
// typeck ensures the conditions for calling a const trait method are met,
664658
// so we only error if the trait isn't const. We try to resolve the trait
665659
// into the concrete method, and uses that for const stability checks.
666-
// FIXME(effects) we might consider moving const stability checks to typeck as well.
667-
if tcx.features().effects() && trait_is_const {
660+
// FIXME(const_trait_impl) we might consider moving const stability checks
661+
// to typeck as well.
662+
if tcx.features().const_trait_impl() && trait_is_const {
668663
// This skips the check below that ensures we only call `const fn`.
669664
is_trait = true;
670665

compiler/rustc_const_eval/src/check_consts/ops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
120120
let implsrc = selcx.select(&obligation);
121121

122122
if let Ok(Some(ImplSource::UserDefined(data))) = implsrc {
123-
// FIXME(effects) revisit this
123+
// FIXME(const_trait_impl) revisit this
124124
if !tcx.is_const_trait_impl(data.impl_def_id) {
125125
let span = tcx.def_span(data.impl_def_id);
126126
err.subdiagnostic(errors::NonConstImplNote { span });

compiler/rustc_const_eval/src/check_consts/qualifs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl Qualif for NeedsNonConstDrop {
192192
return false;
193193
}
194194

195-
// FIXME(effects): Reimplement const drop checking.
195+
// FIXME(const_trait_impl): Reimplement const drop checking.
196196
NeedsDrop::in_any_value_of_ty(cx, ty)
197197
}
198198

compiler/rustc_const_eval/src/const_eval/machine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> {
431431
// sensitive check here. But we can at least rule out functions that are not const at
432432
// all. That said, we have to allow calling functions inside a trait marked with
433433
// #[const_trait]. These *are* const-checked!
434-
// FIXME(effects): why does `is_const_fn` not classify them as const?
434+
// FIXME(const_trait_impl): why does `is_const_fn` not classify them as const?
435435
if (!ecx.tcx.is_const_fn(def) && !ecx.tcx.is_const_default_method(def))
436436
|| ecx.tcx.has_attr(def, sym::rustc_do_not_const_check)
437437
{

compiler/rustc_feature/src/removed.rs

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ declare_features! (
100100
Some("renamed to `doc_notable_trait`")),
101101
/// Allows using `#[unsafe_destructor_blind_to_params]` (RFC 1238).
102102
(removed, dropck_parametricity, "1.38.0", Some(28498), None),
103+
/// Uses generic effect parameters for ~const bounds
104+
(removed, effects, "CURRENT_RUSTC_VERSION", Some(102090),
105+
Some("removed, redundant with `#![feature(const_trait_impl)]`")),
103106
/// Allows defining `existential type`s.
104107
(removed, existential_type, "1.38.0", Some(63063),
105108
Some("removed in favor of `#![feature(type_alias_impl_trait)]`")),

compiler/rustc_feature/src/unstable.rs

-2
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,6 @@ declare_features! (
462462
(unstable, doc_masked, "1.21.0", Some(44027)),
463463
/// Allows `dyn* Trait` objects.
464464
(incomplete, dyn_star, "1.65.0", Some(102425)),
465-
/// Uses generic effect parameters for ~const bounds
466-
(incomplete, effects, "1.72.0", Some(102090)),
467465
/// Allows exhaustive pattern matching on types that contain uninhabited types.
468466
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
469467
/// Allows explicit tail calls via `become` expression.

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ fn compare_method_predicate_entailment<'tcx>(
205205
trait_m_predicates.instantiate_own(tcx, trait_to_impl_args).map(|(predicate, _)| predicate),
206206
);
207207

208-
// FIXME(effects): This should be replaced with a more dedicated method.
209208
let is_conditionally_const = tcx.is_conditionally_const(impl_def_id);
210209
if is_conditionally_const {
211210
// Augment the hybrid param-env with the const conditions

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
563563
if let Err(guar) = ty.error_reported() {
564564
return ty::Const::new_error(tcx, guar).into();
565565
}
566-
// FIXME(effects) see if we should special case effect params here
567566
if !infer_args && has_default {
568567
tcx.const_param_default(param.def_id)
569568
.instantiate(tcx, preceding_args)

compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ fn trait_predicates_eq<'tcx>(
459459
predicate1: ty::Predicate<'tcx>,
460460
predicate2: ty::Predicate<'tcx>,
461461
) -> bool {
462-
// FIXME(effects)
462+
// FIXME(const_trait_impl)
463463
predicate1 == predicate2
464464
}
465465

compiler/rustc_hir_typeck/src/callee.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
461461
}
462462
(fn_sig, Some(def_id))
463463
}
464-
// FIXME(effects): these arms should error because we can't enforce them
464+
// FIXME(const_trait_impl): these arms should error because we can't enforce them
465465
ty::FnPtr(sig_tys, hdr) => (sig_tys.with(hdr), None),
466466
_ => {
467467
for arg in arg_exprs {
@@ -843,11 +843,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
843843
callee_did: DefId,
844844
callee_args: GenericArgsRef<'tcx>,
845845
) {
846-
// FIXME(effects): We should be enforcing these effects unconditionally.
846+
// FIXME(const_trait_impl): We should be enforcing these effects unconditionally.
847847
// This can be done as soon as we convert the standard library back to
848848
// using const traits, since if we were to enforce these conditions now,
849849
// we'd fail on basically every builtin trait call (i.e. `1 + 2`).
850-
if !self.tcx.features().effects() {
850+
if !self.tcx.features().const_trait_impl() {
851851
return;
852852
}
853853

@@ -864,11 +864,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
864864
None => return,
865865
};
866866

867-
// FIXME(effects): Should this be `is_const_fn_raw`? It depends on if we move
867+
// FIXME(const_trait_impl): Should this be `is_const_fn_raw`? It depends on if we move
868868
// const stability checking here too, I guess.
869869
if self.tcx.is_conditionally_const(callee_did) {
870870
let q = self.tcx.const_conditions(callee_did);
871-
// FIXME(effects): Use this span with a better cause code.
871+
// FIXME(const_trait_impl): Use this span with a better cause code.
872872
for (cond, _) in q.instantiate(self.tcx, callee_args) {
873873
self.register_predicate(Obligation::new(
874874
self.tcx,
@@ -878,7 +878,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
878878
));
879879
}
880880
} else {
881-
// FIXME(effects): This should eventually be caught here.
881+
// FIXME(const_trait_impl): This should eventually be caught here.
882882
// For now, though, we defer some const checking to MIR.
883883
}
884884
}

compiler/rustc_middle/src/ty/context.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3125,7 +3125,6 @@ impl<'tcx> TyCtxt<'tcx> {
31253125
}
31263126
}
31273127

3128-
// FIXME(effects): Please remove this. It's a footgun.
31293128
/// Whether the trait impl is marked const. This does not consider stability or feature gates.
31303129
pub fn is_const_trait_impl(self, def_id: DefId) -> bool {
31313130
self.def_kind(def_id) == DefKind::Impl { of_trait: true }

compiler/rustc_next_trait_solver/src/solve/effect_goals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ where
8484
let cx = ecx.cx();
8585
let mut candidates = vec![];
8686

87-
// FIXME(effects): We elaborate here because the implied const bounds
87+
// FIXME(const_trait_impl): We elaborate here because the implied const bounds
8888
// aren't necessarily elaborated. We probably should prefix this query
8989
// with `explicit_`...
9090
for clause in elaborate::elaborate(

compiler/rustc_next_trait_solver/src/solve/trait_goals.rs

-2
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,6 @@ where
609609
return Err(NoSolution);
610610
}
611611

612-
// FIXME(effects): Implement this when we get const working in the new solver
613-
614612
// `Destruct` is automatically implemented for every type in
615613
// non-const environments.
616614
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)

compiler/rustc_passes/src/stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
217217

218218
// `impl const Trait for Type` items forward their const stability to their
219219
// immediate children.
220-
// FIXME(effects): how is this supposed to interact with `#[rustc_const_stable_indirect]`?
220+
// FIXME(const_trait_impl): how is this supposed to interact with `#[rustc_const_stable_indirect]`?
221221
// Currently, once that is set, we do not inherit anything from the parent any more.
222222
if const_stab.is_none() {
223223
debug!("annotate: const_stab not found, parent = {:?}", self.parent_const_stab);

compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
538538
}
539539

540540
ty::PredicateKind::Clause(ty::ClauseKind::HostEffect(predicate)) => {
541-
// FIXME(effects): We should recompute the predicate with `~const`
541+
// FIXME(const_trait_impl): We should recompute the predicate with `~const`
542542
// if it's `const`, and if it holds, explain that this bound only
543543
// *conditionally* holds. If that fails, we should also do selection
544544
// to drill this down to an impl or built-in source, so we can
@@ -2641,7 +2641,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
26412641
_span: Span,
26422642
) -> UnsatisfiedConst {
26432643
let unsatisfied_const = UnsatisfiedConst(false);
2644-
// FIXME(effects)
2644+
// FIXME(const_trait_impl)
26452645
unsatisfied_const
26462646
}
26472647

@@ -3052,7 +3052,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
30523052
// Make a fresh inference variable so we can determine what the generic parameters
30533053
// of the trait are.
30543054
let var = self.next_ty_var(DUMMY_SP);
3055-
// FIXME(effects)
3055+
// FIXME(const_trait_impl)
30563056
let trait_ref = ty::TraitRef::new(self.tcx, trait_def_id, [ty.skip_binder(), var]);
30573057
let obligation = Obligation::new(
30583058
self.tcx,

compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3751,7 +3751,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
37513751
trait_pred.skip_binder().self_ty(),
37523752
diagnostic_name,
37533753
),
3754-
// FIXME(effects, const_trait_impl) derive_const as suggestion?
3754+
// FIXME(const_trait_impl) derive_const as suggestion?
37553755
format!("#[derive({diagnostic_name})]\n"),
37563756
Applicability::MaybeIncorrect,
37573757
);

compiler/rustc_trait_selection/src/traits/fulfill.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
374374
| ty::PredicateKind::Coerce(_)
375375
| ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(..))
376376
| ty::PredicateKind::ConstEquate(..)
377-
// FIXME(effects): We may need to do this using the higher-ranked
377+
// FIXME(const_trait_impl): We may need to do this using the higher-ranked
378378
// pred instead of just instantiating it with placeholders b/c of
379379
// higher-ranked implied bound issues in the old solver.
380380
| ty::PredicateKind::Clause(ty::ClauseKind::HostEffect(..)) => {

compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1170,8 +1170,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11701170
_obligation: &PolyTraitObligation<'tcx>,
11711171
candidates: &mut SelectionCandidateSet<'tcx>,
11721172
) {
1173-
// FIXME(effects): Destruct is not const yet, and it is implemented
1174-
// by all types today in non-const setting.
11751173
candidates.vec.push(BuiltinCandidate { has_nested: false });
11761174
}
11771175

compiler/rustc_ty_utils/src/instance.rs

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ fn resolve_instance_raw<'tcx>(
8181
}
8282
} else {
8383
debug!(" => free item");
84-
// FIXME(effects): we may want to erase the effect param if that is present on this item.
8584
ty::InstanceKind::Item(def_id)
8685
};
8786

compiler/rustc_type_ir/src/predicate.rs

-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ impl<I: Interner> UpcastFrom<I, TraitRef<I>> for TraitPredicate<I> {
174174

175175
impl<I: Interner> fmt::Debug for TraitPredicate<I> {
176176
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
177-
// FIXME(effects) printing?
178177
write!(f, "TraitPredicate({:?}, polarity:{:?})", self.trait_ref, self.polarity)
179178
}
180179
}

library/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()

library/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
///

library/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"]

library/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;

src/librustdoc/clean/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ pub(crate) fn clean_predicate<'tcx>(
369369
ty::ClauseKind::ConstEvaluatable(..)
370370
| ty::ClauseKind::WellFormed(..)
371371
| ty::ClauseKind::ConstArgHasType(..)
372-
// FIXME(effects): We can probably use this `HostEffect` pred to render `~const`.
372+
// FIXME(const_trait_impl): We can probably use this `HostEffect` pred to render `~const`.
373373
| ty::ClauseKind::HostEffect(_) => None,
374374
}
375375
}
@@ -379,7 +379,7 @@ fn clean_poly_trait_predicate<'tcx>(
379379
cx: &mut DocContext<'tcx>,
380380
) -> Option<WherePredicate> {
381381
// `T: ~const Destruct` is hidden because `T: Destruct` is a no-op.
382-
// FIXME(effects) check constness
382+
// FIXME(const_trait_impl) check constness
383383
if Some(pred.skip_binder().def_id()) == cx.tcx.lang_items().destruct_trait() {
384384
return None;
385385
}

src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,15 +404,15 @@ fn is_stable_const_fn(tcx: TyCtxt<'_>, def_id: DefId, msrv: &Msrv) -> bool {
404404
}
405405

406406
fn is_ty_const_destruct<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, body: &Body<'tcx>) -> bool {
407-
// FIXME(effects, fee1-dead) revert to const destruct once it works again
407+
// FIXME(const_trait_impl, fee1-dead) revert to const destruct once it works again
408408
#[expect(unused)]
409409
fn is_ty_const_destruct_unused<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, body: &Body<'tcx>) -> bool {
410410
// Avoid selecting for simple cases, such as builtin types.
411411
if ty::util::is_trivially_const_drop(ty) {
412412
return true;
413413
}
414414

415-
// FIXME(effects) constness
415+
// FIXME(const_trait_impl) constness
416416
let obligation = Obligation::new(
417417
tcx,
418418
ObligationCause::dummy_with_span(body.span),

src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.fixed

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn main() {}
104104

105105
struct D;
106106

107-
/* FIXME(effects)
107+
/* FIXME(const_trait_impl)
108108
impl const Drop for D {
109109
fn drop(&mut self) {
110110
todo!();
@@ -113,7 +113,7 @@ impl const Drop for D {
113113
*/
114114

115115
// Lint this, since it can be dropped in const contexts
116-
// FIXME(effects)
116+
// FIXME(const_trait_impl)
117117
const fn d(this: D) {}
118118
//~^ ERROR: this could be a `const fn`
119119

src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn main() {}
104104

105105
struct D;
106106

107-
/* FIXME(effects)
107+
/* FIXME(const_trait_impl)
108108
impl const Drop for D {
109109
fn drop(&mut self) {
110110
todo!();
@@ -113,7 +113,7 @@ impl const Drop for D {
113113
*/
114114

115115
// Lint this, since it can be dropped in const contexts
116-
// FIXME(effects)
116+
// FIXME(const_trait_impl)
117117
fn d(this: D) {}
118118
//~^ ERROR: this could be a `const fn`
119119

0 commit comments

Comments
 (0)