mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Add run-rustfix for outer_expn_data
This commit is contained in:
parent
a3418933c6
commit
dea92fada5
3 changed files with 29 additions and 2 deletions
25
tests/ui/outer_expn_data.fixed
Normal file
25
tests/ui/outer_expn_data.fixed
Normal file
|
@ -0,0 +1,25 @@
|
|||
// run-rustfix
|
||||
|
||||
#![deny(clippy::internal)]
|
||||
#![feature(rustc_private)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc;
|
||||
use rustc::hir::Expr;
|
||||
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
||||
|
||||
declare_lint! {
|
||||
pub TEST_LINT,
|
||||
Warn,
|
||||
""
|
||||
}
|
||||
|
||||
declare_lint_pass!(Pass => [TEST_LINT]);
|
||||
|
||||
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
||||
fn check_expr(&mut self, _cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
|
||||
let _ = expr.span.ctxt().outer_expn_data();
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -1,3 +1,5 @@
|
|||
// run-rustfix
|
||||
|
||||
#![deny(clippy::internal)]
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
error: usage of `outer_expn().expn_data()`
|
||||
--> $DIR/outer_expn_data.rs:19:33
|
||||
--> $DIR/outer_expn_data.rs:21:33
|
||||
|
|
||||
LL | let _ = expr.span.ctxt().outer_expn().expn_data();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.outer_expn_data()`
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/outer_expn_data.rs:1:9
|
||||
--> $DIR/outer_expn_data.rs:3:9
|
||||
|
|
||||
LL | #![deny(clippy::internal)]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
Loading…
Reference in a new issue