Skip to content

Commit e5d8e94

Browse files
Fix more FIXMEs
1 parent 5b906d5 commit e5d8e94

File tree

8 files changed

+14
-28
lines changed

8 files changed

+14
-28
lines changed

compiler/rustc_borrowck/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ fn do_mir_borrowck<'tcx>(
189189

190190
let location_table = LocationTable::new(body);
191191

192-
let move_data = MoveData::gather_moves(body, tcx, param_env, |_| true);
192+
let move_data = MoveData::gather_moves(body, tcx, |_| true);
193193
let promoted_move_data = promoted
194194
.iter_enumerated()
195-
.map(|(idx, body)| (idx, MoveData::gather_moves(body, tcx, param_env, |_| true)));
195+
.map(|(idx, body)| (idx, MoveData::gather_moves(body, tcx, |_| true)));
196196

197197
let mut flow_inits = MaybeInitializedPlaces::new(tcx, body, &move_data)
198198
.into_engine(tcx, body)

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,10 @@ fn check_simd(tcx: TyCtxt<'_>, sp: Span, def_id: LocalDefId) {
10861086
return;
10871087
}
10881088

1089-
// TODO:
1089+
// FIXME(repr_simd): This check is nice, but perhaps unnecessary due to the fact
1090+
// we do not expect users to implement their own `repr(simd)` types. If they could,
1091+
// this check is easily side-steppable by hiding the const behind normalization.
1092+
// The consequence is that the error is, in general, only observable post-mono.
10901093
if let Some(len) = len_const.try_to_target_usize(tcx) {
10911094
if len == 0 {
10921095
struct_span_code_err!(tcx.dcx(), sp, E0075, "SIMD vector cannot be empty").emit();

compiler/rustc_hir_analysis/src/check/intrinsicck.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> {
7676

7777
let (size, ty) = match elem_ty.kind() {
7878
ty::Array(ty, len) => {
79-
if let Some(len) =
80-
// TODO:
81-
len.try_to_target_usize(self.tcx)
82-
{
79+
if let Some(len) = len.try_to_target_usize(self.tcx) {
8380
(len, *ty)
8481
} else {
8582
return None;

compiler/rustc_mir_dataflow/src/move_paths/builder.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,12 @@ struct MoveDataBuilder<'a, 'tcx, F> {
1818
body: &'a Body<'tcx>,
1919
loc: Location,
2020
tcx: TyCtxt<'tcx>,
21-
// TODO:
22-
#[allow(unused)]
23-
param_env: ty::ParamEnv<'tcx>,
2421
data: MoveData<'tcx>,
2522
filter: F,
2623
}
2724

2825
impl<'a, 'tcx, F: Fn(Ty<'tcx>) -> bool> MoveDataBuilder<'a, 'tcx, F> {
29-
fn new(
30-
body: &'a Body<'tcx>,
31-
tcx: TyCtxt<'tcx>,
32-
param_env: ty::ParamEnv<'tcx>,
33-
filter: F,
34-
) -> Self {
26+
fn new(body: &'a Body<'tcx>, tcx: TyCtxt<'tcx>, filter: F) -> Self {
3527
let mut move_paths = IndexVec::new();
3628
let mut path_map = IndexVec::new();
3729
let mut init_path_map = IndexVec::new();
@@ -61,7 +53,6 @@ impl<'a, 'tcx, F: Fn(Ty<'tcx>) -> bool> MoveDataBuilder<'a, 'tcx, F> {
6153
body,
6254
loc: Location::START,
6355
tcx,
64-
param_env,
6556
data: MoveData {
6657
moves: IndexVec::new(),
6758
loc_map: LocationMap::new(body),
@@ -310,10 +301,9 @@ impl<'a, 'tcx, F: Fn(Ty<'tcx>) -> bool> MoveDataBuilder<'a, 'tcx, F> {
310301
pub(super) fn gather_moves<'tcx>(
311302
body: &Body<'tcx>,
312303
tcx: TyCtxt<'tcx>,
313-
param_env: ty::ParamEnv<'tcx>,
314304
filter: impl Fn(Ty<'tcx>) -> bool,
315305
) -> MoveData<'tcx> {
316-
let mut builder = MoveDataBuilder::new(body, tcx, param_env, filter);
306+
let mut builder = MoveDataBuilder::new(body, tcx, filter);
317307

318308
builder.gather_args();
319309

compiler/rustc_mir_dataflow/src/move_paths/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::ops::{Index, IndexMut};
44
use rustc_data_structures::fx::FxHashMap;
55
use rustc_index::{IndexSlice, IndexVec};
66
use rustc_middle::mir::*;
7-
use rustc_middle::ty::{ParamEnv, Ty, TyCtxt};
7+
use rustc_middle::ty::{Ty, TyCtxt};
88
use rustc_span::Span;
99
use smallvec::SmallVec;
1010

@@ -352,10 +352,9 @@ impl<'tcx> MoveData<'tcx> {
352352
pub fn gather_moves(
353353
body: &Body<'tcx>,
354354
tcx: TyCtxt<'tcx>,
355-
param_env: ParamEnv<'tcx>,
356355
filter: impl Fn(Ty<'tcx>) -> bool,
357356
) -> MoveData<'tcx> {
358-
builder::gather_moves(body, tcx, param_env, filter)
357+
builder::gather_moves(body, tcx, filter)
359358
}
360359

361360
/// For the move path `mpi`, returns the root local variable that starts the path.

compiler/rustc_mir_dataflow/src/rustc_peek.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ pub fn sanity_check<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
4040
debug!("running rustc_peek::SanityCheck on {}", tcx.def_path_str(def_id));
4141
}
4242

43-
let param_env = tcx.param_env(def_id);
44-
let move_data = MoveData::gather_moves(body, tcx, param_env, |_| true);
43+
let move_data = MoveData::gather_moves(body, tcx, |_| true);
4544

4645
if has_rustc_mir_with(tcx, def_id, sym::rustc_peek_maybe_init).is_some() {
4746
let flow_inits = MaybeInitializedPlaces::new(tcx, body, &move_data)

compiler/rustc_mir_transform/src/elaborate_drops.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ impl<'tcx> crate::MirPass<'tcx> for ElaborateDrops {
5858
let param_env = tcx.param_env_reveal_all_normalized(def_id);
5959
// For types that do not need dropping, the behaviour is trivial. So we only need to track
6060
// init/uninit for types that do need dropping.
61-
let move_data =
62-
MoveData::gather_moves(body, tcx, param_env, |ty| ty.needs_drop(tcx, param_env));
61+
let move_data = MoveData::gather_moves(body, tcx, |ty| ty.needs_drop(tcx, param_env));
6362
let elaborate_patch = {
6463
let env = MoveDataParamEnv { move_data, param_env };
6564

compiler/rustc_mir_transform/src/remove_uninit_drops.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ pub(super) struct RemoveUninitDrops;
1919
impl<'tcx> crate::MirPass<'tcx> for RemoveUninitDrops {
2020
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
2121
let param_env = tcx.param_env(body.source.def_id());
22-
let move_data =
23-
MoveData::gather_moves(body, tcx, param_env, |ty| ty.needs_drop(tcx, param_env));
22+
let move_data = MoveData::gather_moves(body, tcx, |ty| ty.needs_drop(tcx, param_env));
2423

2524
let mut maybe_inits = MaybeInitializedPlaces::new(tcx, body, &move_data)
2625
.into_engine(tcx, body)

0 commit comments

Comments
 (0)