Skip to content

Commit acb90eb

Browse files
committed
Fix tidy issues
1 parent 9978574 commit acb90eb

File tree

2 files changed

+53
-40
lines changed

2 files changed

+53
-40
lines changed

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

+51-39
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,59 @@
11
//! This pass type-checks the MIR to ensure it is not broken.
22
3-
use crate::borrow_check::borrow_set::BorrowSet;
4-
use crate::borrow_check::location::LocationTable;
5-
use crate::borrow_check::nll::constraints::{OutlivesConstraintSet, OutlivesConstraint};
6-
use crate::borrow_check::nll::member_constraints::MemberConstraintSet;
7-
use crate::borrow_check::nll::facts::AllFacts;
8-
use crate::borrow_check::nll::region_infer::values::LivenessValues;
9-
use crate::borrow_check::nll::region_infer::values::PlaceholderIndex;
10-
use crate::borrow_check::nll::region_infer::values::PlaceholderIndices;
11-
use crate::borrow_check::nll::region_infer::values::RegionValueElements;
12-
use crate::borrow_check::nll::region_infer::{ClosureRegionRequirementsExt, TypeTest};
13-
use crate::borrow_check::nll::renumber;
14-
use crate::borrow_check::nll::type_check::free_region_relations::{
15-
CreateResult, UniversalRegionRelations,
16-
};
17-
use crate::borrow_check::nll::universal_regions::{DefiningTy, UniversalRegions};
18-
use crate::borrow_check::nll::ToRegionVid;
19-
use crate::transform::promote_consts::should_suggest_const_in_array_repeat_expressions_attribute;
20-
use crate::dataflow::move_paths::MoveData;
21-
use crate::dataflow::FlowAtLocation;
22-
use crate::dataflow::MaybeInitializedPlaces;
3+
use std::{fmt, iter, mem};
4+
use std::rc::Rc;
5+
236
use either::Either;
7+
248
use rustc::hir;
259
use rustc::hir::def_id::DefId;
10+
use rustc::infer::{InferCtxt, InferOk, LateBoundRegionConversionTime, NLLRegionVariableOrigin};
2611
use rustc::infer::canonical::QueryRegionConstraints;
2712
use rustc::infer::outlives::env::RegionBoundPairs;
28-
use rustc::infer::{InferCtxt, InferOk, LateBoundRegionConversionTime, NLLRegionVariableOrigin};
2913
use rustc::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
14+
use rustc::mir::*;
3015
use rustc::mir::interpret::PanicInfo;
3116
use rustc::mir::tcx::PlaceTy;
32-
use rustc::mir::visit::{PlaceContext, Visitor, NonMutatingUseContext};
33-
use rustc::mir::*;
17+
use rustc::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor};
18+
use rustc::traits::{self, ObligationCause, PredicateObligations};
19+
use rustc::traits::query::{Fallible, NoSolution};
3420
use rustc::traits::query::type_op;
3521
use rustc::traits::query::type_op::custom::CustomTypeOp;
36-
use rustc::traits::query::{Fallible, NoSolution};
37-
use rustc::traits::{self, ObligationCause, PredicateObligations};
38-
use rustc::ty::adjustment::{PointerCast};
39-
use rustc::ty::cast::CastTy;
40-
use rustc::ty::fold::TypeFoldable;
41-
use rustc::ty::subst::{Subst, SubstsRef, GenericArgKind, UserSubsts};
4222
use rustc::ty::{
43-
self, RegionVid, ToPolyTraitRef, Ty, TyCtxt, UserType,
44-
CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations,
23+
self, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, RegionVid, ToPolyTraitRef, Ty,
24+
TyCtxt, UserType,
4525
UserTypeAnnotationIndex,
4626
};
47-
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
48-
use rustc_index::vec::{IndexVec, Idx};
27+
use rustc::ty::adjustment::PointerCast;
28+
use rustc::ty::cast::CastTy;
29+
use rustc::ty::fold::TypeFoldable;
4930
use rustc::ty::layout::VariantIdx;
50-
use std::rc::Rc;
51-
use std::{fmt, iter, mem};
52-
use syntax_pos::{Span, DUMMY_SP};
53-
31+
use rustc::ty::subst::{GenericArgKind, Subst, SubstsRef, UserSubsts};
32+
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
5433
use rustc_error_codes::*;
34+
use rustc_index::vec::{Idx, IndexVec};
35+
use syntax_pos::{DUMMY_SP, Span};
36+
37+
use crate::borrow_check::borrow_set::BorrowSet;
38+
use crate::borrow_check::location::LocationTable;
39+
use crate::borrow_check::nll::constraints::{OutlivesConstraint, OutlivesConstraintSet};
40+
use crate::borrow_check::nll::facts::AllFacts;
41+
use crate::borrow_check::nll::member_constraints::MemberConstraintSet;
42+
use crate::borrow_check::nll::region_infer::{ClosureRegionRequirementsExt, TypeTest};
43+
use crate::borrow_check::nll::region_infer::values::LivenessValues;
44+
use crate::borrow_check::nll::region_infer::values::PlaceholderIndex;
45+
use crate::borrow_check::nll::region_infer::values::PlaceholderIndices;
46+
use crate::borrow_check::nll::region_infer::values::RegionValueElements;
47+
use crate::borrow_check::nll::renumber;
48+
use crate::borrow_check::nll::ToRegionVid;
49+
use crate::borrow_check::nll::type_check::free_region_relations::{
50+
CreateResult, UniversalRegionRelations,
51+
};
52+
use crate::borrow_check::nll::universal_regions::{DefiningTy, UniversalRegions};
53+
use crate::dataflow::FlowAtLocation;
54+
use crate::dataflow::MaybeInitializedPlaces;
55+
use crate::dataflow::move_paths::MoveData;
56+
use crate::transform::promote_consts::should_suggest_const_in_array_repeat_expressions_attribute;
5557

5658
macro_rules! span_mirbug {
5759
($context:expr, $elem:expr, $($message:tt)*) => ({
@@ -1374,7 +1376,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
13741376
self.infcx.tcx
13751377
}
13761378

1377-
fn check_stmt(&mut self, body: ReadOnlyBodyCache<'_, 'tcx>, stmt: &Statement<'tcx>, location: Location) {
1379+
fn check_stmt(
1380+
&mut self,
1381+
body: ReadOnlyBodyCache<'_, 'tcx>,
1382+
stmt: &Statement<'tcx>,
1383+
location: Location)
1384+
{
13781385
debug!("check_stmt: {:?}", stmt);
13791386
let tcx = self.tcx();
13801387
match stmt.kind {
@@ -1985,7 +1992,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19851992
}
19861993
}
19871994

1988-
fn check_rvalue(&mut self, body: ReadOnlyBodyCache<'_, 'tcx>, rvalue: &Rvalue<'tcx>, location: Location) {
1995+
fn check_rvalue(
1996+
&mut self,
1997+
body: ReadOnlyBodyCache<'_, 'tcx>,
1998+
rvalue: &Rvalue<'tcx>,
1999+
location: Location)
2000+
{
19892001
let tcx = self.tcx();
19902002

19912003
match rvalue {

src/librustc_mir/transform/promote_consts.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ impl<'tcx> MirPass<'tcx> for PromoteTemps<'tcx> {
6363
let mut rpo = traversal::reverse_postorder(body);
6464
let (temps, all_candidates) = collect_temps_and_candidates(tcx, body, &mut rpo);
6565

66-
let promotable_candidates = validate_candidates(tcx, read_only, def_id, &temps, &all_candidates);
66+
let promotable_candidates
67+
= validate_candidates(tcx, read_only, def_id, &temps, &all_candidates);
6768

6869
let promoted = promote_candidates(def_id, body, tcx, temps, promotable_candidates);
6970
self.promoted_fragments.set(promoted);

0 commit comments

Comments
 (0)