@@ -76,26 +76,26 @@ declare_clippy_lint! {
7676}
7777
7878declare_clippy_lint ! {
79- /// **What it does:** Checks for calls to `cx.outer().expn_info ()` and suggests to use
80- /// the `cx.outer_expn_info ()`
79+ /// **What it does:** Checks for calls to `cx.outer().expn_data ()` and suggests to use
80+ /// the `cx.outer_expn_data ()`
8181 ///
82- /// **Why is this bad?** `cx.outer_expn_info ()` is faster and more concise.
82+ /// **Why is this bad?** `cx.outer_expn_data ()` is faster and more concise.
8383 ///
8484 /// **Known problems:** None.
8585 ///
8686 /// **Example:**
8787 /// Bad:
8888 /// ```rust,ignore
89- /// expr.span.ctxt().outer().expn_info ()
89+ /// expr.span.ctxt().outer().expn_data ()
9090 /// ```
9191 ///
9292 /// Good:
9393 /// ```rust,ignore
94- /// expr.span.ctxt().outer_expn_info ()
94+ /// expr.span.ctxt().outer_expn_data ()
9595 /// ```
96- pub OUTER_EXPN_EXPN_INFO ,
96+ pub OUTER_EXPN_EXPN_DATA ,
9797 internal,
98- "using `cx.outer_expn().expn_info ()` instead of `cx.outer_expn_info ()`"
98+ "using `cx.outer_expn().expn_data ()` instead of `cx.outer_expn_data ()`"
9999}
100100
101101declare_lint_pass ! ( ClippyLintsInternal => [ CLIPPY_LINTS_INTERNAL ] ) ;
@@ -180,11 +180,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
180180 // not able to capture the error.
181181 // Therefore, we need to climb the macro expansion tree and find the
182182 // actual span that invoked `declare_tool_lint!`:
183- let lint_span = lint_span
184- . ctxt ( )
185- . outer_expn_info ( )
186- . map ( |ei| ei. call_site )
187- . expect ( "unable to get call_site" ) ;
183+ let lint_span = lint_span. ctxt ( ) . outer_expn_data ( ) . call_site ;
188184
189185 if !self . registered_lints . contains ( lint_name) {
190186 span_lint (
@@ -278,17 +274,17 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CompilerLintFunctions {
278274 }
279275}
280276
281- pub struct OuterExpnInfoPass ;
277+ pub struct OuterExpnDataPass ;
282278
283- impl_lint_pass ! ( OuterExpnInfoPass => [ OUTER_EXPN_EXPN_INFO ] ) ;
279+ impl_lint_pass ! ( OuterExpnDataPass => [ OUTER_EXPN_EXPN_DATA ] ) ;
284280
285- impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for OuterExpnInfoPass {
281+ impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for OuterExpnDataPass {
286282 fn check_expr ( & mut self , cx : & LateContext < ' a , ' tcx > , expr : & ' tcx hir:: Expr ) {
287283 let ( method_names, arg_lists) = method_calls ( expr, 2 ) ;
288284 let method_names: Vec < LocalInternedString > = method_names. iter ( ) . map ( |s| s. as_str ( ) ) . collect ( ) ;
289285 let method_names: Vec < & str > = method_names. iter ( ) . map ( std:: convert:: AsRef :: as_ref) . collect ( ) ;
290286 if_chain ! {
291- if let [ "expn_info " , "outer_expn" ] = method_names. as_slice( ) ;
287+ if let [ "expn_data " , "outer_expn" ] = method_names. as_slice( ) ;
292288 let args = arg_lists[ 1 ] ;
293289 if args. len( ) == 1 ;
294290 let self_arg = & args[ 0 ] ;
@@ -297,11 +293,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OuterExpnInfoPass {
297293 then {
298294 span_lint_and_sugg(
299295 cx,
300- OUTER_EXPN_EXPN_INFO ,
296+ OUTER_EXPN_EXPN_DATA ,
301297 expr. span. trim_start( self_arg. span) . unwrap_or( expr. span) ,
302- "usage of `outer_expn().expn_info ()`" ,
298+ "usage of `outer_expn().expn_data ()`" ,
303299 "try" ,
304- ".outer_expn_info ()" . to_string( ) ,
300+ ".outer_expn_data ()" . to_string( ) ,
305301 Applicability :: MachineApplicable ,
306302 ) ;
307303 }
0 commit comments