Skip to content

Commit 8d730ed

Browse files
committed
Run Rustfix on librustc_mir
1 parent fb7980d commit 8d730ed

File tree

11 files changed

+36
-36
lines changed

11 files changed

+36
-36
lines changed

src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl<'gcx, 'tcx> UseFinder<'gcx, 'tcx> {
176176
None
177177
}
178178

179-
fn def_use(&self, location: Location, thing: &MirVisitable<'tcx>) -> (bool, bool) {
179+
fn def_use(&self, location: Location, thing: &dyn MirVisitable<'tcx>) -> (bool, bool) {
180180
let mut visitor = DefUseVisitor {
181181
defined: false,
182182
used: false,

src/librustc_mir/borrow_check/nll/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ fn dump_annotation<'a, 'gcx, 'tcx>(
260260

261261
fn for_each_region_constraint(
262262
closure_region_requirements: &ClosureRegionRequirements,
263-
with_msg: &mut FnMut(&str) -> io::Result<()>,
263+
with_msg: &mut dyn FnMut(&str) -> io::Result<()>,
264264
) -> io::Result<()> {
265265
for req in &closure_region_requirements.outlives_requirements {
266-
let subject: &Debug = match &req.subject {
266+
let subject: &dyn Debug = match &req.subject {
267267
ClosureOutlivesSubject::Region(subject) => subject,
268268
ClosureOutlivesSubject::Ty(ty) => ty,
269269
};

src/librustc_mir/borrow_check/nll/region_infer/dump_mir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const REGION_WIDTH: usize = 8;
2323

2424
impl<'tcx> RegionInferenceContext<'tcx> {
2525
/// Write out our state into the `.mir` files.
26-
pub(crate) fn dump_mir(&self, out: &mut Write) -> io::Result<()> {
26+
pub(crate) fn dump_mir(&self, out: &mut dyn Write) -> io::Result<()> {
2727
writeln!(out, "| Free Region Mapping")?;
2828

2929
for region in self.regions() {
@@ -67,7 +67,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
6767
/// inference resulted in the values that it did when debugging.
6868
fn for_each_constraint(
6969
&self,
70-
with_msg: &mut FnMut(&str) -> io::Result<()>,
70+
with_msg: &mut dyn FnMut(&str) -> io::Result<()>,
7171
) -> io::Result<()> {
7272
for region in self.definitions.indices() {
7373
let value = self.liveness_constraints.region_value_str(region);

src/librustc_mir/borrow_check/nll/region_infer/graphviz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use super::*;
2020

2121
impl<'tcx> RegionInferenceContext<'tcx> {
2222
/// Write out the region constraint graph.
23-
pub(crate) fn dump_graphviz(&self, mut w: &mut Write) -> io::Result<()> {
23+
pub(crate) fn dump_graphviz(&self, mut w: &mut dyn Write) -> io::Result<()> {
2424
dot::render(self, &mut w)
2525
}
2626
}

src/librustc_mir/borrow_check/nll/type_check/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn type_check_internal<'gcx, 'tcx>(
127127
mir: &Mir<'tcx>,
128128
region_bound_pairs: &[(ty::Region<'tcx>, GenericKind<'tcx>)],
129129
implicit_region_bound: Option<ty::Region<'tcx>>,
130-
extra: &mut FnMut(&mut TypeChecker<'_, 'gcx, 'tcx>),
130+
extra: &mut dyn FnMut(&mut TypeChecker<'_, 'gcx, 'tcx>),
131131
) -> MirTypeckRegionConstraints<'tcx> {
132132
let mut checker = TypeChecker::new(
133133
infcx,
@@ -231,7 +231,7 @@ impl<'a, 'b, 'gcx, 'tcx> TypeVerifier<'a, 'b, 'gcx, 'tcx> {
231231
self.cx.infcx.tcx
232232
}
233233

234-
fn sanitize_type(&mut self, parent: &fmt::Debug, ty: Ty<'tcx>) -> Ty<'tcx> {
234+
fn sanitize_type(&mut self, parent: &dyn fmt::Debug, ty: Ty<'tcx>) -> Ty<'tcx> {
235235
if ty.has_escaping_regions() || ty.references_error() {
236236
span_mirbug_and_err!(self, parent, "bad type {:?}", ty)
237237
} else {
@@ -516,7 +516,7 @@ impl<'a, 'b, 'gcx, 'tcx> TypeVerifier<'a, 'b, 'gcx, 'tcx> {
516516

517517
fn field_ty(
518518
&mut self,
519-
parent: &fmt::Debug,
519+
parent: &dyn fmt::Debug,
520520
base_ty: PlaceTy<'tcx>,
521521
field: Field,
522522
location: Location,
@@ -1171,7 +1171,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
11711171
fn assert_iscleanup(
11721172
&mut self,
11731173
mir: &Mir<'tcx>,
1174-
ctxt: &fmt::Debug,
1174+
ctxt: &dyn fmt::Debug,
11751175
bb: BasicBlock,
11761176
iscleanuppad: bool,
11771177
) {

src/librustc_mir/dataflow/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub(crate) struct DataflowBuilder<'a, 'tcx: 'a, BD> where BD: BitDenotation
6161
pub(crate) struct DebugFormatted(String);
6262

6363
impl DebugFormatted {
64-
pub fn new(input: &fmt::Debug) -> DebugFormatted {
64+
pub fn new(input: &dyn fmt::Debug) -> DebugFormatted {
6565
DebugFormatted(format!("{:?}", input))
6666
}
6767
}

src/librustc_mir/interpret/const_eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl Error for ConstEvalError {
168168
}
169169
}
170170

171-
fn cause(&self) -> Option<&Error> {
171+
fn cause(&self) -> Option<&dyn Error> {
172172
None
173173
}
174174
}

src/librustc_mir/transform/dump_mir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl fmt::Display for Disambiguator {
4949

5050

5151
pub fn on_mir_pass<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
52-
pass_num: &fmt::Display,
52+
pass_num: &dyn fmt::Display,
5353
pass_name: &str,
5454
source: MirSource,
5555
mir: &Mir<'tcx>,

src/librustc_mir/transform/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub macro run_passes($tcx:ident, $mir:ident, $def_id:ident, $suite_index:expr; $
161161
promoted
162162
};
163163
let mut index = 0;
164-
let mut run_pass = |pass: &MirPass| {
164+
let mut run_pass = |pass: &dyn MirPassPassPass| {
165165
let run_hooks = |mir: &_, index, is_after| {
166166
dump_mir::on_mir_pass($tcx, &format_args!("{:03}-{:03}", suite_index, index),
167167
&pass.name(), source, mir, is_after);

src/librustc_mir/util/liveness.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,12 @@ pub fn write_mir_fn<'a, 'tcx>(
425425
tcx: TyCtxt<'a, 'tcx, 'tcx>,
426426
src: MirSource,
427427
mir: &Mir<'tcx>,
428-
w: &mut Write,
428+
w: &mut dyn Write,
429429
result: &LivenessResult,
430430
) -> io::Result<()> {
431431
write_mir_intro(tcx, src, mir, w)?;
432432
for block in mir.basic_blocks().indices() {
433-
let print = |w: &mut Write, prefix, result: &IndexVec<BasicBlock, LocalSet>| {
433+
let print = |w: &mut dyn Write, prefix, result: &IndexVec<BasicBlock, LocalSet>| {
434434
let live: Vec<String> = mir.local_decls
435435
.indices()
436436
.filter(|i| result[block].contains(i))

0 commit comments

Comments
 (0)