@@ -22,7 +22,7 @@ use super::{InitializationRequiringAction, PrefixSet};
2222use super :: error_reporting:: { IncludingDowncast , UseSpans } ;
2323use crate :: dataflow:: drop_flag_effects;
2424use crate :: dataflow:: indexes:: { MovePathIndex , MoveOutIndex } ;
25- use crate :: util:: borrowck_errors:: { BorrowckErrors , Origin } ;
25+ use crate :: util:: borrowck_errors:: BorrowckErrors ;
2626
2727#[ derive( Debug ) ]
2828struct MoveSite {
@@ -94,7 +94,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
9494 desired_action. as_noun ( ) ,
9595 & self . describe_place_with_options ( moved_place, IncludingDowncast ( true ) )
9696 . unwrap_or_else ( || "_" . to_owned ( ) ) ,
97- Origin :: Mir ,
9897 ) ;
9998 err. span_label ( span, format ! ( "use of possibly uninitialized {}" , item_msg) ) ;
10099
@@ -125,7 +124,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
125124 desired_action. as_noun ( ) ,
126125 msg,
127126 self . describe_place_with_options ( & moved_place, IncludingDowncast ( true ) ) ,
128- Origin :: Mir ,
129127 ) ;
130128
131129 self . add_moved_or_invoked_closure_note (
@@ -286,7 +284,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
286284 let mut err = tcx. cannot_move_when_borrowed (
287285 span,
288286 & self . describe_place ( place) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
289- Origin :: Mir ,
290287 ) ;
291288 err. span_label ( borrow_span, format ! ( "borrow of {} occurs here" , borrow_msg) ) ;
292289 err. span_label ( span, format ! ( "move out of {} occurs here" , value_msg) ) ;
@@ -331,7 +328,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
331328 borrow_span,
332329 & self . describe_place ( & borrow. borrowed_place )
333330 . unwrap_or_else ( || "_" . to_owned ( ) ) ,
334- Origin :: Mir ,
335331 ) ;
336332
337333 borrow_spans. var_span_label ( & mut err, {
@@ -398,7 +394,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
398394 rgt,
399395 & msg_borrow,
400396 None ,
401- Origin :: Mir ,
402397 )
403398 }
404399 ( BorrowKind :: Mut { .. } , _, lft, BorrowKind :: Shared , rgt, _) => {
@@ -413,7 +408,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
413408 rgt,
414409 & msg_borrow,
415410 None ,
416- Origin :: Mir ,
417411 )
418412 }
419413
@@ -426,7 +420,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
426420 issued_span,
427421 & msg_borrow,
428422 None ,
429- Origin :: Mir ,
430423 )
431424 }
432425
@@ -437,7 +430,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
437430 & desc_place,
438431 issued_span,
439432 None ,
440- Origin :: Mir ,
441433 )
442434 }
443435
@@ -448,7 +440,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
448440 issued_span,
449441 & desc_place,
450442 "mutably borrow" ,
451- Origin :: Mir ,
452443 ) ;
453444 borrow_spans. var_span_label (
454445 & mut err,
@@ -471,7 +462,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
471462 "it" ,
472463 "" ,
473464 None ,
474- Origin :: Mir ,
475465 )
476466 } ,
477467
@@ -487,7 +477,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
487477 "" ,
488478 None ,
489479 second_borrow_desc,
490- Origin :: Mir ,
491480 )
492481 }
493482
@@ -503,7 +492,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
503492 "" ,
504493 None ,
505494 second_borrow_desc,
506- Origin :: Mir ,
507495 )
508496 }
509497
@@ -836,7 +824,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
836824 let mut err = self . infcx . tcx . path_does_not_live_long_enough (
837825 borrow_span,
838826 & format ! ( "`{}`" , name) ,
839- Origin :: Mir ,
840827 ) ;
841828
842829 if let Some ( annotation) = self . annotate_argument_and_return_for_borrow ( borrow) {
@@ -927,7 +914,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
927914
928915 let mut err = self . infcx
929916 . tcx
930- . cannot_borrow_across_destructor ( borrow_span, Origin :: Mir ) ;
917+ . cannot_borrow_across_destructor ( borrow_span) ;
931918
932919 let what_was_dropped = match self . describe_place ( place) {
933920 Some ( name) => format ! ( "`{}`" , name. as_str( ) ) ,
@@ -980,7 +967,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
980967
981968 let mut err = self . infcx
982969 . tcx
983- . thread_local_value_does_not_live_long_enough ( borrow_span, Origin :: Mir ) ;
970+ . thread_local_value_does_not_live_long_enough ( borrow_span) ;
984971
985972 err. span_label (
986973 borrow_span,
@@ -1025,7 +1012,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
10251012 }
10261013
10271014 let tcx = self . infcx . tcx ;
1028- let mut err = tcx. temporary_value_borrowed_for_too_long ( proper_span, Origin :: Mir ) ;
1015+ let mut err = tcx. temporary_value_borrowed_for_too_long ( proper_span) ;
10291016 err. span_label (
10301017 proper_span,
10311018 "creates a temporary which is freed while still in use" ,
@@ -1137,7 +1124,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
11371124 return_kind,
11381125 reference_desc,
11391126 & place_desc,
1140- Origin :: Mir ,
11411127 ) ;
11421128
11431129 if return_span != borrow_span {
@@ -1162,7 +1148,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
11621148 args_span,
11631149 captured_var,
11641150 var_span,
1165- Origin :: Mir ,
11661151 ) ;
11671152
11681153 let suggestion = match tcx. sess . source_map ( ) . span_to_snippet ( args_span) {
@@ -1218,7 +1203,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
12181203 "function"
12191204 } ;
12201205
1221- let mut err = tcx. borrowed_data_escapes_closure ( escape_span, escapes_from, Origin :: Mir ) ;
1206+ let mut err = tcx. borrowed_data_escapes_closure ( escape_span, escapes_from) ;
12221207
12231208 err. span_label (
12241209 upvar_span,
@@ -1367,7 +1352,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
13671352 loan_span,
13681353 & self . describe_place ( place) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
13691354 "assign" ,
1370- Origin :: Mir ,
13711355 ) ;
13721356 loan_spans. var_span_label (
13731357 & mut err,
@@ -1383,7 +1367,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
13831367 span,
13841368 loan_span,
13851369 & self . describe_place ( place) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
1386- Origin :: Mir ,
13871370 ) ;
13881371
13891372 loan_spans. var_span_label (
@@ -1448,7 +1431,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
14481431 span,
14491432 place_description. as_ref ( ) . map ( AsRef :: as_ref) . unwrap_or ( "_" ) ,
14501433 from_arg,
1451- Origin :: Mir ,
14521434 ) ;
14531435 let msg = if from_arg {
14541436 "cannot assign to immutable argument"
0 commit comments