|
14 | 14 | use borrow_check::nll::region_infer::Cause;
|
15 | 15 | use borrow_check::nll::region_infer::ClosureRegionRequirementsExt;
|
16 | 16 | use borrow_check::nll::universal_regions::UniversalRegions;
|
| 17 | +use dataflow::move_paths::MoveData; |
17 | 18 | use dataflow::FlowAtLocation;
|
18 | 19 | use dataflow::MaybeInitializedPlaces;
|
19 |
| -use dataflow::move_paths::MoveData; |
20 | 20 | use rustc::hir::def_id::DefId;
|
21 |
| -use rustc::infer::{InferCtxt, InferOk, InferResult, LateBoundRegionConversionTime, UnitResult}; |
22 | 21 | use rustc::infer::region_constraints::{GenericKind, RegionConstraintData};
|
23 |
| -use rustc::traits::{self, Normalized, TraitEngine}; |
| 22 | +use rustc::infer::{InferCtxt, InferOk, InferResult, LateBoundRegionConversionTime, UnitResult}; |
| 23 | +use rustc::mir::tcx::PlaceTy; |
| 24 | +use rustc::mir::visit::{PlaceContext, Visitor}; |
| 25 | +use rustc::mir::*; |
24 | 26 | use rustc::traits::query::NoSolution;
|
| 27 | +use rustc::traits::{self, Normalized, TraitEngine}; |
25 | 28 | use rustc::ty::error::TypeError;
|
26 | 29 | use rustc::ty::fold::TypeFoldable;
|
27 | 30 | use rustc::ty::{self, ToPolyTraitRef, Ty, TyCtxt, TypeVariants};
|
28 |
| -use rustc::mir::*; |
29 |
| -use rustc::mir::tcx::PlaceTy; |
30 |
| -use rustc::mir::visit::{PlaceContext, Visitor}; |
31 | 31 | use std::fmt;
|
32 | 32 | use syntax::ast;
|
33 | 33 | use syntax_pos::{Span, DUMMY_SP};
|
@@ -61,8 +61,8 @@ macro_rules! span_mirbug_and_err {
|
61 | 61 | })
|
62 | 62 | }
|
63 | 63 |
|
64 |
| -mod liveness; |
65 | 64 | mod input_output;
|
| 65 | +mod liveness; |
66 | 66 |
|
67 | 67 | /// Type checks the given `mir` in the context of the inference
|
68 | 68 | /// context `infcx`. Returns any region constraints that have yet to
|
@@ -763,9 +763,12 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
|
763 | 763 | }
|
764 | 764 | StatementKind::UserAssertTy(ref c_ty, ref local) => {
|
765 | 765 | let local_ty = mir.local_decls()[*local].ty;
|
766 |
| - let (ty, _) = self.infcx.instantiate_canonical_with_fresh_inference_vars( |
767 |
| - stmt.source_info.span, c_ty); |
768 |
| - debug!("check_stmt: user_assert_ty ty={:?} local_ty={:?}", ty, local_ty); |
| 766 | + let (ty, _) = self.infcx |
| 767 | + .instantiate_canonical_with_fresh_inference_vars(stmt.source_info.span, c_ty); |
| 768 | + debug!( |
| 769 | + "check_stmt: user_assert_ty ty={:?} local_ty={:?}", |
| 770 | + ty, local_ty |
| 771 | + ); |
769 | 772 | if let Err(terr) = self.eq_types(ty, local_ty, location.at_self()) {
|
770 | 773 | span_mirbug!(
|
771 | 774 | self,
|
@@ -1513,9 +1516,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
|
1513 | 1516 |
|
1514 | 1517 | fn prove_trait_ref(&mut self, trait_ref: ty::TraitRef<'tcx>, location: Location) {
|
1515 | 1518 | self.prove_predicates(
|
1516 |
| - &[ |
1517 |
| - ty::Predicate::Trait(trait_ref.to_poly_trait_ref().to_poly_trait_predicate()), |
1518 |
| - ], |
| 1519 | + &[ty::Predicate::Trait( |
| 1520 | + trait_ref.to_poly_trait_ref().to_poly_trait_predicate(), |
| 1521 | + )], |
1519 | 1522 | location,
|
1520 | 1523 | );
|
1521 | 1524 | }
|
|
0 commit comments