]> git.lizzy.rs Git - rust.git/commitdiff
Remove unused parameter in borrowck error reporting
authorMatthew Jasper <mjjasper1@gmail.com>
Sat, 4 May 2019 09:10:37 +0000 (10:10 +0100)
committerMatthew Jasper <mjjasper1@gmail.com>
Tue, 21 May 2019 19:38:17 +0000 (20:38 +0100)
src/librustc_mir/borrow_check/conflict_errors.rs

index 19f29f346f96f4b149b17d2543afdbe593b0f1a9..b00a75bb56968109c59f1ea2789a218e4546b33a 100644 (file)
@@ -1,6 +1,5 @@
 use rustc::hir;
 use rustc::hir::def_id::DefId;
-use rustc::middle::region::ScopeTree;
 use rustc::mir::{
     self, AggregateKind, BindingForm, BorrowKind, ClearCrossCrate, ConstraintCategory, Local,
     LocalDecl, LocalKind, Location, Operand, Place, PlaceBase, PlaceProjection,
@@ -689,7 +688,6 @@ pub(super) fn report_borrowed_value_does_not_live_long_enough(
         );
 
         let drop_span = place_span.1;
-        let scope_tree = self.infcx.tcx.region_scope_tree(self.mir_def_id);
         let root_place = self.prefixes(&borrow.borrowed_place, PrefixSet::All)
             .last()
             .unwrap();
@@ -791,7 +789,6 @@ pub(super) fn report_borrowed_value_does_not_live_long_enough(
             (Some(name), explanation) => self.report_local_value_does_not_live_long_enough(
                 location,
                 &name,
-                &scope_tree,
                 &borrow,
                 drop_span,
                 borrow_spans,
@@ -799,7 +796,6 @@ pub(super) fn report_borrowed_value_does_not_live_long_enough(
             ),
             (None, explanation) => self.report_temporary_value_does_not_live_long_enough(
                 location,
-                &scope_tree,
                 &borrow,
                 drop_span,
                 borrow_spans,
@@ -815,7 +811,6 @@ fn report_local_value_does_not_live_long_enough(
         &mut self,
         location: Location,
         name: &str,
-        scope_tree: &'tcx ScopeTree,
         borrow: &BorrowData<'tcx>,
         drop_span: Span,
         borrow_spans: UseSpans,
@@ -823,9 +818,9 @@ fn report_local_value_does_not_live_long_enough(
     ) -> DiagnosticBuilder<'cx> {
         debug!(
             "report_local_value_does_not_live_long_enough(\
-             {:?}, {:?}, {:?}, {:?}, {:?}, {:?}\
+             {:?}, {:?}, {:?}, {:?}, {:?}\
              )",
-            location, name, scope_tree, borrow, drop_span, borrow_spans
+            location, name, borrow, drop_span, borrow_spans
         );
 
         let borrow_span = borrow_spans.var_or_use();
@@ -1007,7 +1002,6 @@ fn report_thread_local_value_does_not_live_long_enough(
     fn report_temporary_value_does_not_live_long_enough(
         &mut self,
         location: Location,
-        scope_tree: &'tcx ScopeTree,
         borrow: &BorrowData<'tcx>,
         drop_span: Span,
         borrow_spans: UseSpans,
@@ -1016,9 +1010,9 @@ fn report_temporary_value_does_not_live_long_enough(
     ) -> DiagnosticBuilder<'cx> {
         debug!(
             "report_temporary_value_does_not_live_long_enough(\
-             {:?}, {:?}, {:?}, {:?}, {:?}\
+             {:?}, {:?}, {:?}, {:?}\
              )",
-            location, scope_tree, borrow, drop_span, proper_span
+            location, borrow, drop_span, proper_span
         );
 
         if let BorrowExplanation::MustBeValidFor {