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