@@ -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 ] ) ;
@@ -182,9 +182,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
182182 // actual span that invoked `declare_tool_lint!`:
183183 let lint_span = lint_span
184184 . ctxt ( )
185- . outer_expn_info ( )
186- . map ( |ei| ei. call_site )
187- . expect ( "unable to get call_site" ) ;
185+ . outer_expn_data ( )
186+ . call_site ;
188187
189188 if !self . registered_lints . contains ( lint_name) {
190189 span_lint (
@@ -278,17 +277,17 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CompilerLintFunctions {
278277 }
279278}
280279
281- pub struct OuterExpnInfoPass ;
280+ pub struct OuterExpnDataPass ;
282281
283- impl_lint_pass ! ( OuterExpnInfoPass => [ OUTER_EXPN_EXPN_INFO ] ) ;
282+ impl_lint_pass ! ( OuterExpnDataPass => [ OUTER_EXPN_EXPN_DATA ] ) ;
284283
285- impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for OuterExpnInfoPass {
284+ impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for OuterExpnDataPass {
286285 fn check_expr ( & mut self , cx : & LateContext < ' a , ' tcx > , expr : & ' tcx hir:: Expr ) {
287286 let ( method_names, arg_lists) = method_calls ( expr, 2 ) ;
288287 let method_names: Vec < LocalInternedString > = method_names. iter ( ) . map ( |s| s. as_str ( ) ) . collect ( ) ;
289288 let method_names: Vec < & str > = method_names. iter ( ) . map ( std:: convert:: AsRef :: as_ref) . collect ( ) ;
290289 if_chain ! {
291- if let [ "expn_info " , "outer_expn" ] = method_names. as_slice( ) ;
290+ if let [ "expn_data " , "outer_expn" ] = method_names. as_slice( ) ;
292291 let args = arg_lists[ 1 ] ;
293292 if args. len( ) == 1 ;
294293 let self_arg = & args[ 0 ] ;
@@ -297,11 +296,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OuterExpnInfoPass {
297296 then {
298297 span_lint_and_sugg(
299298 cx,
300- OUTER_EXPN_EXPN_INFO ,
299+ OUTER_EXPN_EXPN_DATA ,
301300 expr. span. trim_start( self_arg. span) . unwrap_or( expr. span) ,
302- "usage of `outer_expn().expn_info ()`" ,
301+ "usage of `outer_expn().expn_data ()`" ,
303302 "try" ,
304- ".outer_expn_info ()" . to_string( ) ,
303+ ".outer_expn_data ()" . to_string( ) ,
305304 Applicability :: MachineApplicable ,
306305 ) ;
307306 }
0 commit comments