1
1
use std:: { fmt, env} ;
2
2
3
+ use crate :: hir;
3
4
use crate :: hir:: map:: definitions:: DefPathData ;
4
5
use crate :: mir;
5
6
use crate :: ty:: { self , Ty , layout} ;
@@ -14,7 +15,6 @@ use crate::ty::query::TyCtxtAt;
14
15
use errors:: DiagnosticBuilder ;
15
16
16
17
use syntax_pos:: { Pos , Span } ;
17
- use syntax:: ast;
18
18
use syntax:: symbol:: Symbol ;
19
19
20
20
#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
@@ -50,7 +50,7 @@ pub struct ConstEvalErr<'tcx> {
50
50
pub struct FrameInfo < ' tcx > {
51
51
pub call_site : Span , // this span is in the caller!
52
52
pub instance : ty:: Instance < ' tcx > ,
53
- pub lint_root : Option < ast :: NodeId > ,
53
+ pub lint_root : Option < hir :: HirId > ,
54
54
}
55
55
56
56
impl < ' tcx > fmt:: Display for FrameInfo < ' tcx > {
@@ -98,7 +98,7 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
98
98
pub fn report_as_lint ( & self ,
99
99
tcx : TyCtxtAt < ' a , ' gcx , ' tcx > ,
100
100
message : & str ,
101
- lint_root : ast :: NodeId ,
101
+ lint_root : hir :: HirId ,
102
102
) -> ErrorHandled {
103
103
let lint = self . struct_generic (
104
104
tcx,
@@ -118,7 +118,7 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
118
118
& self ,
119
119
tcx : TyCtxtAt < ' a , ' gcx , ' tcx > ,
120
120
message : & str ,
121
- lint_root : Option < ast :: NodeId > ,
121
+ lint_root : Option < hir :: HirId > ,
122
122
) -> Result < DiagnosticBuilder < ' tcx > , ErrorHandled > {
123
123
match self . error {
124
124
EvalErrorKind :: Layout ( LayoutError :: Unknown ( _) ) |
@@ -129,15 +129,15 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
129
129
}
130
130
trace ! ( "reporting const eval failure at {:?}" , self . span) ;
131
131
let mut err = if let Some ( lint_root) = lint_root {
132
- let node_id = self . stacktrace
132
+ let hir_id = self . stacktrace
133
133
. iter ( )
134
134
. rev ( )
135
135
. filter_map ( |frame| frame. lint_root )
136
136
. next ( )
137
137
. unwrap_or ( lint_root) ;
138
- tcx. struct_span_lint_node (
138
+ tcx. struct_span_lint_hir (
139
139
crate :: rustc:: lint:: builtin:: CONST_ERR ,
140
- node_id ,
140
+ hir_id ,
141
141
tcx. span ,
142
142
message,
143
143
)
0 commit comments