@@ -938,7 +938,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
938
938
}
939
939
940
940
fn suggest_trait_and_bounds (
941
- & mut self ,
941
+ & self ,
942
942
err : & mut Diag < ' _ > ,
943
943
source : PathSource < ' _ , ' _ , ' _ > ,
944
944
res : Option < Res > ,
@@ -1139,7 +1139,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1139
1139
1140
1140
/// Emit special messages for unresolved `Self` and `self`.
1141
1141
fn suggest_self_ty (
1142
- & mut self ,
1142
+ & self ,
1143
1143
err : & mut Diag < ' _ > ,
1144
1144
source : PathSource < ' _ , ' _ , ' _ > ,
1145
1145
path : & [ Segment ] ,
@@ -1247,7 +1247,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1247
1247
}
1248
1248
1249
1249
fn detect_missing_binding_available_from_pattern (
1250
- & mut self ,
1250
+ & self ,
1251
1251
err : & mut Diag < ' _ > ,
1252
1252
path : & [ Segment ] ,
1253
1253
following_seg : Option < & Segment > ,
@@ -1293,11 +1293,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1293
1293
}
1294
1294
}
1295
1295
1296
- fn suggest_at_operator_in_slice_pat_with_range (
1297
- & mut self ,
1298
- err : & mut Diag < ' _ > ,
1299
- path : & [ Segment ] ,
1300
- ) {
1296
+ fn suggest_at_operator_in_slice_pat_with_range ( & self , err : & mut Diag < ' _ > , path : & [ Segment ] ) {
1301
1297
let Some ( pat) = self . diag_metadata . current_pat else { return } ;
1302
1298
let ( bound, side, range) = match & pat. kind {
1303
1299
ast:: PatKind :: Range ( Some ( bound) , None , range) => ( bound, Side :: Start , range) ,
@@ -1358,7 +1354,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1358
1354
}
1359
1355
1360
1356
fn explain_functions_in_pattern (
1361
- & mut self ,
1357
+ & self ,
1362
1358
err : & mut Diag < ' _ > ,
1363
1359
res : Option < Res > ,
1364
1360
source : PathSource < ' _ , ' _ , ' _ > ,
@@ -1370,7 +1366,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1370
1366
}
1371
1367
1372
1368
fn suggest_changing_type_to_const_param (
1373
- & mut self ,
1369
+ & self ,
1374
1370
err : & mut Diag < ' _ > ,
1375
1371
res : Option < Res > ,
1376
1372
source : PathSource < ' _ , ' _ , ' _ > ,
@@ -1420,7 +1416,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1420
1416
}
1421
1417
1422
1418
fn suggest_pattern_match_with_let (
1423
- & mut self ,
1419
+ & self ,
1424
1420
err : & mut Diag < ' _ > ,
1425
1421
source : PathSource < ' _ , ' _ , ' _ > ,
1426
1422
span : Span ,
@@ -1475,7 +1471,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1475
1471
}
1476
1472
1477
1473
/// Given `where <T as Bar>::Baz: String`, suggest `where T: Bar<Baz = String>`.
1478
- fn restrict_assoc_type_in_where_clause ( & mut self , span : Span , err : & mut Diag < ' _ > ) -> bool {
1474
+ fn restrict_assoc_type_in_where_clause ( & self , span : Span , err : & mut Diag < ' _ > ) -> bool {
1479
1475
// Detect that we are actually in a `where` predicate.
1480
1476
let ( bounded_ty, bounds, where_span) = if let Some ( ast:: WherePredicate {
1481
1477
kind :
@@ -1623,7 +1619,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
1623
1619
let ns = source. namespace ( ) ;
1624
1620
let is_expected = & |res| source. is_expected ( res) ;
1625
1621
1626
- let path_sep = |this : & mut Self , err : & mut Diag < ' _ > , expr : & Expr , kind : DefKind | {
1622
+ let path_sep = |this : & Self , err : & mut Diag < ' _ > , expr : & Expr , kind : DefKind | {
1627
1623
const MESSAGE : & str = "use the path separator to refer to an item" ;
1628
1624
1629
1625
let ( lhs_span, rhs_span) = match & expr. kind {
@@ -2575,7 +2571,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
2575
2571
2576
2572
// try to give a suggestion for this pattern: `name = blah`, which is common in other languages
2577
2573
// suggest `let name = blah` to introduce a new binding
2578
- fn let_binding_suggestion ( & mut self , err : & mut Diag < ' _ > , ident_span : Span ) -> bool {
2574
+ fn let_binding_suggestion ( & self , err : & mut Diag < ' _ > , ident_span : Span ) -> bool {
2579
2575
if ident_span. from_expansion ( ) {
2580
2576
return false ;
2581
2577
}
0 commit comments