@@ -31,37 +31,37 @@ impl FromStr for Mode {
31
31
}
32
32
33
33
struct ShowSpanVisitor < ' a > {
34
- span_diagnostic : & ' a rustc_errors:: DiagCtxt ,
34
+ dcx : & ' a rustc_errors:: DiagCtxt ,
35
35
mode : Mode ,
36
36
}
37
37
38
38
impl < ' a > Visitor < ' a > for ShowSpanVisitor < ' a > {
39
39
fn visit_expr ( & mut self , e : & ' a ast:: Expr ) {
40
40
if let Mode :: Expression = self . mode {
41
- self . span_diagnostic . emit_warning ( errors:: ShowSpan { span : e. span , msg : "expression" } ) ;
41
+ self . dcx . emit_warning ( errors:: ShowSpan { span : e. span , msg : "expression" } ) ;
42
42
}
43
43
visit:: walk_expr ( self , e) ;
44
44
}
45
45
46
46
fn visit_pat ( & mut self , p : & ' a ast:: Pat ) {
47
47
if let Mode :: Pattern = self . mode {
48
- self . span_diagnostic . emit_warning ( errors:: ShowSpan { span : p. span , msg : "pattern" } ) ;
48
+ self . dcx . emit_warning ( errors:: ShowSpan { span : p. span , msg : "pattern" } ) ;
49
49
}
50
50
visit:: walk_pat ( self , p) ;
51
51
}
52
52
53
53
fn visit_ty ( & mut self , t : & ' a ast:: Ty ) {
54
54
if let Mode :: Type = self . mode {
55
- self . span_diagnostic . emit_warning ( errors:: ShowSpan { span : t. span , msg : "type" } ) ;
55
+ self . dcx . emit_warning ( errors:: ShowSpan { span : t. span , msg : "type" } ) ;
56
56
}
57
57
visit:: walk_ty ( self , t) ;
58
58
}
59
59
}
60
60
61
- pub fn run ( span_diagnostic : & rustc_errors:: DiagCtxt , mode : & str , krate : & ast:: Crate ) {
61
+ pub fn run ( dcx : & rustc_errors:: DiagCtxt , mode : & str , krate : & ast:: Crate ) {
62
62
let Ok ( mode) = mode. parse ( ) else {
63
63
return ;
64
64
} ;
65
- let mut v = ShowSpanVisitor { span_diagnostic , mode } ;
65
+ let mut v = ShowSpanVisitor { dcx , mode } ;
66
66
visit:: walk_crate ( & mut v, krate) ;
67
67
}
0 commit comments