11use std:: { fmt, env} ;
22
3+ use crate :: hir;
34use crate :: hir:: map:: definitions:: DefPathData ;
45use crate :: mir;
56use crate :: ty:: { self , Ty , layout} ;
@@ -14,7 +15,6 @@ use crate::ty::query::TyCtxtAt;
1415use errors:: DiagnosticBuilder ;
1516
1617use syntax_pos:: { Pos , Span } ;
17- use syntax:: ast;
1818use syntax:: symbol:: Symbol ;
1919
2020#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
@@ -50,7 +50,7 @@ pub struct ConstEvalErr<'tcx> {
5050pub struct FrameInfo < ' tcx > {
5151 pub call_site : Span , // this span is in the caller!
5252 pub instance : ty:: Instance < ' tcx > ,
53- pub lint_root : Option < ast :: NodeId > ,
53+ pub lint_root : Option < hir :: HirId > ,
5454}
5555
5656impl < ' tcx > fmt:: Display for FrameInfo < ' tcx > {
@@ -98,7 +98,7 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
9898 pub fn report_as_lint ( & self ,
9999 tcx : TyCtxtAt < ' a , ' gcx , ' tcx > ,
100100 message : & str ,
101- lint_root : ast :: NodeId ,
101+ lint_root : hir :: HirId ,
102102 ) -> ErrorHandled {
103103 let lint = self . struct_generic (
104104 tcx,
@@ -118,7 +118,7 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
118118 & self ,
119119 tcx : TyCtxtAt < ' a , ' gcx , ' tcx > ,
120120 message : & str ,
121- lint_root : Option < ast :: NodeId > ,
121+ lint_root : Option < hir :: HirId > ,
122122 ) -> Result < DiagnosticBuilder < ' tcx > , ErrorHandled > {
123123 match self . error {
124124 EvalErrorKind :: Layout ( LayoutError :: Unknown ( _) ) |
@@ -129,15 +129,15 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
129129 }
130130 trace ! ( "reporting const eval failure at {:?}" , self . span) ;
131131 let mut err = if let Some ( lint_root) = lint_root {
132- let node_id = self . stacktrace
132+ let hir_id = self . stacktrace
133133 . iter ( )
134134 . rev ( )
135135 . filter_map ( |frame| frame. lint_root )
136136 . next ( )
137137 . unwrap_or ( lint_root) ;
138- tcx. struct_span_lint_node (
138+ tcx. struct_span_lint_hir (
139139 crate :: rustc:: lint:: builtin:: CONST_ERR ,
140- node_id ,
140+ hir_id ,
141141 tcx. span ,
142142 message,
143143 )
0 commit comments