@@ -923,7 +923,7 @@ impl<'tcx> NamePrivacyVisitor<'tcx> {
923
923
924
924
// Checks that a field in a struct constructor (expression or pattern) is accessible.
925
925
fn check_field (
926
- & mut self ,
926
+ & self ,
927
927
hir_id : hir:: HirId , // ID of the field use
928
928
use_ctxt : Span , // syntax context of the field name at the use site
929
929
def : ty:: AdtDef < ' tcx > , // definition of the struct or enum
@@ -941,7 +941,7 @@ impl<'tcx> NamePrivacyVisitor<'tcx> {
941
941
942
942
// Checks that a field in a struct constructor (expression or pattern) is accessible.
943
943
fn emit_unreachable_field_error (
944
- & mut self ,
944
+ & self ,
945
945
fields : Vec < ( Symbol , Span , bool /* field is present */ ) > ,
946
946
def : ty:: AdtDef < ' tcx > , // definition of the struct or enum
947
947
update_syntax : Option < Span > ,
@@ -1004,7 +1004,7 @@ impl<'tcx> NamePrivacyVisitor<'tcx> {
1004
1004
}
1005
1005
1006
1006
fn check_expanded_fields (
1007
- & mut self ,
1007
+ & self ,
1008
1008
adt : ty:: AdtDef < ' tcx > ,
1009
1009
variant : & ' tcx ty:: VariantDef ,
1010
1010
fields : & [ hir:: ExprField < ' tcx > ] ,
@@ -1142,7 +1142,7 @@ impl<'tcx> TypePrivacyVisitor<'tcx> {
1142
1142
result. is_break ( )
1143
1143
}
1144
1144
1145
- fn check_def_id ( & mut self , def_id : DefId , kind : & str , descr : & dyn fmt:: Display ) -> bool {
1145
+ fn check_def_id ( & self , def_id : DefId , kind : & str , descr : & dyn fmt:: Display ) -> bool {
1146
1146
let is_error = !self . item_is_accessible ( def_id) ;
1147
1147
if is_error {
1148
1148
self . tcx . dcx ( ) . emit_err ( ItemIsPrivate { span : self . span , kind, descr : descr. into ( ) } ) ;
@@ -1401,7 +1401,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
1401
1401
self
1402
1402
}
1403
1403
1404
- fn check_def_id ( & mut self , def_id : DefId , kind : & str , descr : & dyn fmt:: Display ) -> bool {
1404
+ fn check_def_id ( & self , def_id : DefId , kind : & str , descr : & dyn fmt:: Display ) -> bool {
1405
1405
if self . leaks_private_dep ( def_id) {
1406
1406
self . tcx . emit_node_span_lint (
1407
1407
lint:: builtin:: EXPORTED_PRIVATE_DEPENDENCIES ,
0 commit comments