Skip to content

Commit 482ec7f

Browse files
authored
Unrolled build for rust-lang#124918
Rollup merge of rust-lang#124918 - nnethercote:FIXME-lcnr, r=lcnr Eliminate some `FIXME(lcnr)` comments In some cases this involved changing code. In some cases the comment was able to removed or replaced. r? ``@lcnr``
2 parents 98dabb6 + df6f713 commit 482ec7f

File tree

8 files changed

+12
-51
lines changed

8 files changed

+12
-51
lines changed

compiler/rustc_borrowck/src/renumber.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ pub fn renumber_mir<'tcx>(
2626
renumberer.visit_body(body);
2727
}
2828

29-
// FIXME(@lcnr): A lot of these variants overlap and it seems like
30-
// this type is only used to decide which region should be used
31-
// as representative. This should be cleaned up.
29+
// The fields are used only for debugging output in `sccs_info`.
3230
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
3331
pub(crate) enum RegionCtxt {
3432
Location(Location),

compiler/rustc_infer/src/errors/note_and_explain.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,8 @@ impl<'a> DescriptionCtx<'a> {
6969

7070
ty::RePlaceholder(_) | ty::ReError(_) => return None,
7171

72-
// FIXME(#13998) RePlaceholder should probably print like
73-
// ReLateParam rather than dumping Debug output on the user.
74-
//
75-
// We shouldn't really be having unification failures with ReVar
76-
// and ReBound though.
77-
//
78-
// FIXME(@lcnr): figure out why we have to handle `ReBound`
79-
// here, this feels somewhat off.
8072
ty::ReVar(_) | ty::ReBound(..) | ty::ReErased => {
81-
(alt_span, "revar", format!("{region:?}"))
73+
bug!("unexpected region for DescriptionCtx: {:?}", region);
8274
}
8375
};
8476
Some(DescriptionCtx { span, kind, arg })

compiler/rustc_infer/src/infer/error_reporting/mod.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,9 @@ pub(super) fn note_and_explain_region<'tcx>(
172172

173173
ty::ReError(_) => return,
174174

175-
// We shouldn't really be having unification failures with ReVar
176-
// and ReBound though.
177-
//
178-
// FIXME(@lcnr): Figure out whether this is reachable and if so, why.
179-
ty::ReVar(_) | ty::ReBound(..) | ty::ReErased => (format!("lifetime `{region}`"), alt_span),
175+
ty::ReVar(_) | ty::ReBound(..) | ty::ReErased => {
176+
bug!("unexpected region for note_and_explain_region: {:?}", region);
177+
}
180178
};
181179

182180
emit_msg_span(err, prefix, description, span, suffix);

compiler/rustc_infer/src/infer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,8 @@ pub enum RegionVariableOrigin {
528528

529529
/// Region variables created as the values for early-bound regions.
530530
///
531-
/// FIXME(@lcnr): This can also store a `DefId`, similar to
532-
/// `TypeVariableOriginKind::TypeParameterDefinition`.
531+
/// FIXME(@lcnr): This should also store a `DefId`, similar to
532+
/// `TypeVariableOrigin`.
533533
RegionParameterDefinition(Span, Symbol),
534534

535535
/// Region variables created when instantiating a binder with

compiler/rustc_middle/src/ty/normalize_erasing_regions.rs

+1-22
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ impl<'tcx> TyCtxt<'tcx> {
100100
/// codegen, we need to normalize the contents.
101101
// FIXME(@lcnr): This method should not be necessary, we now normalize
102102
// inside of binders. We should be able to only use
103-
// `tcx.instantiate_bound_regions_with_erased`. Same for the `try_X`
104-
// variant.
103+
// `tcx.instantiate_bound_regions_with_erased`.
105104
#[tracing::instrument(level = "debug", skip(self, param_env))]
106105
pub fn normalize_erasing_late_bound_regions<T>(
107106
self,
@@ -115,26 +114,6 @@ impl<'tcx> TyCtxt<'tcx> {
115114
self.normalize_erasing_regions(param_env, value)
116115
}
117116

118-
/// If you have a `Binder<'tcx, T>`, you can do this to strip out the
119-
/// late-bound regions and then normalize the result, yielding up
120-
/// a `T` (with regions erased). This is appropriate when the
121-
/// binder is being instantiated at the call site.
122-
///
123-
/// N.B., currently, higher-ranked type bounds inhibit
124-
/// normalization. Therefore, each time we erase them in
125-
/// codegen, we need to normalize the contents.
126-
pub fn try_normalize_erasing_late_bound_regions<T>(
127-
self,
128-
param_env: ty::ParamEnv<'tcx>,
129-
value: ty::Binder<'tcx, T>,
130-
) -> Result<T, NormalizationError<'tcx>>
131-
where
132-
T: TypeFoldable<TyCtxt<'tcx>>,
133-
{
134-
let value = self.instantiate_bound_regions_with_erased(value);
135-
self.try_normalize_erasing_regions(param_env, value)
136-
}
137-
138117
/// Monomorphizes a type from the AST by first applying the
139118
/// in-scope instantiations and then normalizing any associated
140119
/// types.

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

-2
Original file line numberDiff line numberDiff line change
@@ -3443,8 +3443,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
34433443
self.dcx().try_steal_replace_and_emit_err(self.tcx.def_span(def_id), StashKey::Cycle, err)
34443444
}
34453445

3446-
// FIXME(@lcnr): This function could be changed to trait `TraitRef` directly
3447-
// instead of using a `Binder`.
34483446
fn report_signature_mismatch_error(
34493447
&self,
34503448
obligation: &PredicateObligation<'tcx>,

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
693693

694694
let vtable_base = vtable_trait_first_method_offset(
695695
tcx,
696-
(unnormalized_upcast_trait_ref, ty::Binder::dummy(object_trait_ref)),
696+
unnormalized_upcast_trait_ref,
697+
ty::Binder::dummy(object_trait_ref),
697698
);
698699

699700
Ok(ImplSource::Builtin(BuiltinImplSource::Object { vtable_base: vtable_base }, nested))

compiler/rustc_trait_selection/src/traits/vtable.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,11 @@ fn vtable_entries<'tcx>(
320320
}
321321

322322
/// Find slot base for trait methods within vtable entries of another trait
323-
// FIXME(@lcnr): This isn't a query, so why does it take a tuple as its argument.
324323
pub(super) fn vtable_trait_first_method_offset<'tcx>(
325324
tcx: TyCtxt<'tcx>,
326-
key: (
327-
ty::PolyTraitRef<'tcx>, // trait_to_be_found
328-
ty::PolyTraitRef<'tcx>, // trait_owning_vtable
329-
),
325+
trait_to_be_found: ty::PolyTraitRef<'tcx>,
326+
trait_owning_vtable: ty::PolyTraitRef<'tcx>,
330327
) -> usize {
331-
let (trait_to_be_found, trait_owning_vtable) = key;
332-
333328
// #90177
334329
let trait_to_be_found_erased = tcx.erase_regions(trait_to_be_found);
335330

0 commit comments

Comments
 (0)