Skip to content

Commit e86e5aa

Browse files
Rename the FIXMEs, remove a few that dont matter anymore
1 parent d0497a9 commit e86e5aa

Some content is hidden

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

47 files changed

+58
-68
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

+2-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
657657
// typeck ensures the conditions for calling a const trait method are met,
658658
// so we only error if the trait isn't const. We try to resolve the trait
659659
// into the concrete method, and uses that for const stability checks.
660-
// FIXME(effects) we might consider moving const stability checks to typeck as well.
660+
// FIXME(const_trait_impl) we might consider moving const stability checks
661+
// to typeck as well.
661662
if tcx.features().const_trait_impl() && trait_is_const {
662663
// This skips the check below that ensures we only call `const fn`.
663664
is_trait = true;

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_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

+5-5
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,7 +843,7 @@ 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`).
@@ -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
@@ -533,7 +533,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
533533
}
534534

535535
ty::PredicateKind::Clause(ty::ClauseKind::HostEffect(predicate)) => {
536-
// FIXME(effects): We should recompute the predicate with `~const`
536+
// FIXME(const_trait_impl): We should recompute the predicate with `~const`
537537
// if it's `const`, and if it holds, explain that this bound only
538538
// *conditionally* holds. If that fails, we should also do selection
539539
// to drill this down to an impl or built-in source, so we can
@@ -2572,7 +2572,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
25722572
_span: Span,
25732573
) -> UnsatisfiedConst {
25742574
let unsatisfied_const = UnsatisfiedConst(false);
2575-
// FIXME(effects)
2575+
// FIXME(const_trait_impl)
25762576
unsatisfied_const
25772577
}
25782578

@@ -2983,7 +2983,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
29832983
// Make a fresh inference variable so we can determine what the generic parameters
29842984
// of the trait are.
29852985
let var = self.next_ty_var(DUMMY_SP);
2986-
// FIXME(effects)
2986+
// FIXME(const_trait_impl)
29872987
let trait_ref = ty::TraitRef::new(self.tcx, trait_def_id, [ty.skip_binder(), var]);
29882988
let obligation = Obligation::new(
29892989
self.tcx,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3731,7 +3731,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
37313731
trait_pred.skip_binder().self_ty(),
37323732
diagnostic_name,
37333733
),
3734-
// FIXME(effects, const_trait_impl) derive_const as suggestion?
3734+
// FIXME(const_trait_impl) derive_const as suggestion?
37353735
format!("#[derive({diagnostic_name})]\n"),
37363736
Applicability::MaybeIncorrect,
37373737
);

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

tests/rustdoc/rfc-2632-const-trait-impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// stabilized when changing `@!has` to `@has`, and please do
77
// not remove this test.
88
//
9-
// FIXME(effects) add `const_trait` to `Fn` so we use `~const`
10-
// FIXME(effects) restore `const_trait` to `Destruct`
9+
// FIXME(const_trait_impl) add `const_trait` to `Fn` so we use `~const`
10+
// FIXME(const_trait_impl) restore `const_trait` to `Destruct`
1111
#![allow(incomplete_features)]
1212
#![feature(const_trait_impl, effects)]
1313
#![crate_name = "foo"]
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// FIXME(effects) aux-build:closure-in-foreign-crate.rs
1+
// FIXME(const_trait_impl) aux-build:closure-in-foreign-crate.rs
22
//@ build-pass
33

4-
// FIXME(effects) extern crate closure_in_foreign_crate;
4+
// FIXME(const_trait_impl) extern crate closure_in_foreign_crate;
55

6-
// FIXME(effects) const _: () = closure_in_foreign_crate::test();
6+
// FIXME(const_trait_impl) const _: () = closure_in_foreign_crate::test();
77

88
fn main() {}

tests/ui/consts/const_cmp_type_id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ fn main() {
1313
let _a = TypeId::of::<u8>() < TypeId::of::<u16>();
1414
//~^ ERROR cannot call non-const operator in constants
1515
// can't assert `_a` because it is not deterministic
16-
// FIXME(effects) make it pass
16+
// FIXME(const_trait_impl) make it pass
1717
}
1818
}

tests/ui/traits/const-traits/call-const-closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl Bar for () {
1616
const FOO: () = {
1717
(const || ().foo())();
1818
//~^ ERROR the trait bound `(): ~const Bar` is not satisfied
19-
// FIXME(effects): The constness environment for const closures is wrong.
19+
// FIXME(const_trait_impl): The constness environment for const closures is wrong.
2020
};
2121

2222
fn main() {}

tests/ui/traits/const-traits/call-generic-in-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ known-bug: #110395
2-
// FIXME(effects) check-pass
2+
// FIXME(const_trait_impl) check-pass
33
#![feature(const_trait_impl)]
44

55
#[const_trait]

0 commit comments

Comments
 (0)