@@ -22,7 +22,7 @@ use super::{InitializationRequiringAction, PrefixSet};
22
22
use super :: error_reporting:: { IncludingDowncast , UseSpans } ;
23
23
use crate :: dataflow:: drop_flag_effects;
24
24
use crate :: dataflow:: indexes:: { MovePathIndex , MoveOutIndex } ;
25
- use crate :: util:: borrowck_errors:: { BorrowckErrors , Origin } ;
25
+ use crate :: util:: borrowck_errors:: BorrowckErrors ;
26
26
27
27
#[ derive( Debug ) ]
28
28
struct MoveSite {
@@ -94,7 +94,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
94
94
desired_action. as_noun ( ) ,
95
95
& self . describe_place_with_options ( moved_place, IncludingDowncast ( true ) )
96
96
. unwrap_or_else ( || "_" . to_owned ( ) ) ,
97
- Origin :: Mir ,
98
97
) ;
99
98
err. span_label ( span, format ! ( "use of possibly uninitialized {}" , item_msg) ) ;
100
99
@@ -125,7 +124,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
125
124
desired_action. as_noun ( ) ,
126
125
msg,
127
126
self . describe_place_with_options ( & moved_place, IncludingDowncast ( true ) ) ,
128
- Origin :: Mir ,
129
127
) ;
130
128
131
129
self . add_moved_or_invoked_closure_note (
@@ -286,7 +284,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
286
284
let mut err = tcx. cannot_move_when_borrowed (
287
285
span,
288
286
& self . describe_place ( place) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
289
- Origin :: Mir ,
290
287
) ;
291
288
err. span_label ( borrow_span, format ! ( "borrow of {} occurs here" , borrow_msg) ) ;
292
289
err. span_label ( span, format ! ( "move out of {} occurs here" , value_msg) ) ;
@@ -331,7 +328,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
331
328
borrow_span,
332
329
& self . describe_place ( & borrow. borrowed_place )
333
330
. unwrap_or_else ( || "_" . to_owned ( ) ) ,
334
- Origin :: Mir ,
335
331
) ;
336
332
337
333
borrow_spans. var_span_label ( & mut err, {
@@ -398,7 +394,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
398
394
rgt,
399
395
& msg_borrow,
400
396
None ,
401
- Origin :: Mir ,
402
397
)
403
398
}
404
399
( BorrowKind :: Mut { .. } , _, lft, BorrowKind :: Shared , rgt, _) => {
@@ -413,7 +408,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
413
408
rgt,
414
409
& msg_borrow,
415
410
None ,
416
- Origin :: Mir ,
417
411
)
418
412
}
419
413
@@ -426,7 +420,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
426
420
issued_span,
427
421
& msg_borrow,
428
422
None ,
429
- Origin :: Mir ,
430
423
)
431
424
}
432
425
@@ -437,7 +430,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
437
430
& desc_place,
438
431
issued_span,
439
432
None ,
440
- Origin :: Mir ,
441
433
)
442
434
}
443
435
@@ -448,7 +440,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
448
440
issued_span,
449
441
& desc_place,
450
442
"mutably borrow" ,
451
- Origin :: Mir ,
452
443
) ;
453
444
borrow_spans. var_span_label (
454
445
& mut err,
@@ -471,7 +462,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
471
462
"it" ,
472
463
"" ,
473
464
None ,
474
- Origin :: Mir ,
475
465
)
476
466
} ,
477
467
@@ -487,7 +477,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
487
477
"" ,
488
478
None ,
489
479
second_borrow_desc,
490
- Origin :: Mir ,
491
480
)
492
481
}
493
482
@@ -503,7 +492,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
503
492
"" ,
504
493
None ,
505
494
second_borrow_desc,
506
- Origin :: Mir ,
507
495
)
508
496
}
509
497
@@ -836,7 +824,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
836
824
let mut err = self . infcx . tcx . path_does_not_live_long_enough (
837
825
borrow_span,
838
826
& format ! ( "`{}`" , name) ,
839
- Origin :: Mir ,
840
827
) ;
841
828
842
829
if let Some ( annotation) = self . annotate_argument_and_return_for_borrow ( borrow) {
@@ -927,7 +914,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
927
914
928
915
let mut err = self . infcx
929
916
. tcx
930
- . cannot_borrow_across_destructor ( borrow_span, Origin :: Mir ) ;
917
+ . cannot_borrow_across_destructor ( borrow_span) ;
931
918
932
919
let what_was_dropped = match self . describe_place ( place) {
933
920
Some ( name) => format ! ( "`{}`" , name. as_str( ) ) ,
@@ -980,7 +967,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
980
967
981
968
let mut err = self . infcx
982
969
. 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) ;
984
971
985
972
err. span_label (
986
973
borrow_span,
@@ -1025,7 +1012,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1025
1012
}
1026
1013
1027
1014
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) ;
1029
1016
err. span_label (
1030
1017
proper_span,
1031
1018
"creates a temporary which is freed while still in use" ,
@@ -1137,7 +1124,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1137
1124
return_kind,
1138
1125
reference_desc,
1139
1126
& place_desc,
1140
- Origin :: Mir ,
1141
1127
) ;
1142
1128
1143
1129
if return_span != borrow_span {
@@ -1162,7 +1148,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1162
1148
args_span,
1163
1149
captured_var,
1164
1150
var_span,
1165
- Origin :: Mir ,
1166
1151
) ;
1167
1152
1168
1153
let suggestion = match tcx. sess . source_map ( ) . span_to_snippet ( args_span) {
@@ -1218,7 +1203,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1218
1203
"function"
1219
1204
} ;
1220
1205
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) ;
1222
1207
1223
1208
err. span_label (
1224
1209
upvar_span,
@@ -1367,7 +1352,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1367
1352
loan_span,
1368
1353
& self . describe_place ( place) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
1369
1354
"assign" ,
1370
- Origin :: Mir ,
1371
1355
) ;
1372
1356
loan_spans. var_span_label (
1373
1357
& mut err,
@@ -1383,7 +1367,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1383
1367
span,
1384
1368
loan_span,
1385
1369
& self . describe_place ( place) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
1386
- Origin :: Mir ,
1387
1370
) ;
1388
1371
1389
1372
loan_spans. var_span_label (
@@ -1448,7 +1431,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1448
1431
span,
1449
1432
place_description. as_ref ( ) . map ( AsRef :: as_ref) . unwrap_or ( "_" ) ,
1450
1433
from_arg,
1451
- Origin :: Mir ,
1452
1434
) ;
1453
1435
let msg = if from_arg {
1454
1436
"cannot assign to immutable argument"
0 commit comments