@@ -937,7 +937,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
937
937
}
938
938
939
939
fn suggest_trait_and_bounds (
940
- & mut self ,
940
+ & self ,
941
941
err : & mut Diag < ' _ > ,
942
942
source : PathSource < ' _ , ' _ , ' _ > ,
943
943
res : Option < Res > ,
@@ -1138,7 +1138,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1138
1138
1139
1139
/// Emit special messages for unresolved `Self` and `self`.
1140
1140
fn suggest_self_ty (
1141
- & mut self ,
1141
+ & self ,
1142
1142
err : & mut Diag < ' _ > ,
1143
1143
source : PathSource < ' _ , ' _ , ' _ > ,
1144
1144
path : & [ Segment ] ,
@@ -1254,7 +1254,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1254
1254
}
1255
1255
1256
1256
fn detect_missing_binding_available_from_pattern (
1257
- & mut self ,
1257
+ & self ,
1258
1258
err : & mut Diag < ' _ > ,
1259
1259
path : & [ Segment ] ,
1260
1260
following_seg : Option < & Segment > ,
@@ -1300,11 +1300,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1300
1300
}
1301
1301
}
1302
1302
1303
- fn suggest_at_operator_in_slice_pat_with_range (
1304
- & mut self ,
1305
- err : & mut Diag < ' _ > ,
1306
- path : & [ Segment ] ,
1307
- ) {
1303
+ fn suggest_at_operator_in_slice_pat_with_range ( & self , err : & mut Diag < ' _ > , path : & [ Segment ] ) {
1308
1304
let Some ( pat) = self . diag_metadata . current_pat else { return } ;
1309
1305
let ( bound, side, range) = match & pat. kind {
1310
1306
ast:: PatKind :: Range ( Some ( bound) , None , range) => ( bound, Side :: Start , range) ,
@@ -1365,7 +1361,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1365
1361
}
1366
1362
1367
1363
fn explain_functions_in_pattern (
1368
- & mut self ,
1364
+ & self ,
1369
1365
err : & mut Diag < ' _ > ,
1370
1366
res : Option < Res > ,
1371
1367
source : PathSource < ' _ , ' _ , ' _ > ,
@@ -1377,7 +1373,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1377
1373
}
1378
1374
1379
1375
fn suggest_changing_type_to_const_param (
1380
- & mut self ,
1376
+ & self ,
1381
1377
err : & mut Diag < ' _ > ,
1382
1378
res : Option < Res > ,
1383
1379
source : PathSource < ' _ , ' _ , ' _ > ,
@@ -1427,7 +1423,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1427
1423
}
1428
1424
1429
1425
fn suggest_pattern_match_with_let (
1430
- & mut self ,
1426
+ & self ,
1431
1427
err : & mut Diag < ' _ > ,
1432
1428
source : PathSource < ' _ , ' _ , ' _ > ,
1433
1429
span : Span ,
@@ -1482,7 +1478,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1482
1478
}
1483
1479
1484
1480
/// Given `where <T as Bar>::Baz: String`, suggest `where T: Bar<Baz = String>`.
1485
- fn restrict_assoc_type_in_where_clause ( & mut self , span : Span , err : & mut Diag < ' _ > ) -> bool {
1481
+ fn restrict_assoc_type_in_where_clause ( & self , span : Span , err : & mut Diag < ' _ > ) -> bool {
1486
1482
// Detect that we are actually in a `where` predicate.
1487
1483
let ( bounded_ty, bounds, where_span) = if let Some ( ast:: WherePredicate {
1488
1484
kind :
@@ -1630,7 +1626,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1630
1626
let ns = source. namespace ( ) ;
1631
1627
let is_expected = & |res| source. is_expected ( res) ;
1632
1628
1633
- let path_sep = |this : & mut Self , err : & mut Diag < ' _ > , expr : & Expr , kind : DefKind | {
1629
+ let path_sep = |this : & Self , err : & mut Diag < ' _ > , expr : & Expr , kind : DefKind | {
1634
1630
const MESSAGE : & str = "use the path separator to refer to an item" ;
1635
1631
1636
1632
let ( lhs_span, rhs_span) = match & expr. kind {
@@ -2582,7 +2578,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
2582
2578
2583
2579
// try to give a suggestion for this pattern: `name = blah`, which is common in other languages
2584
2580
// suggest `let name = blah` to introduce a new binding
2585
- fn let_binding_suggestion ( & mut self , err : & mut Diag < ' _ > , ident_span : Span ) -> bool {
2581
+ fn let_binding_suggestion ( & self , err : & mut Diag < ' _ > , ident_span : Span ) -> bool {
2586
2582
if ident_span. from_expansion ( ) {
2587
2583
return false ;
2588
2584
}
0 commit comments