Skip to content

Commit dea92fa

Browse files
committed
Add run-rustfix for outer_expn_data
1 parent a341893 commit dea92fa

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

tests/ui/outer_expn_data.fixed

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// run-rustfix
2+
3+
#![deny(clippy::internal)]
4+
#![feature(rustc_private)]
5+
6+
#[macro_use]
7+
extern crate rustc;
8+
use rustc::hir::Expr;
9+
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
10+
11+
declare_lint! {
12+
pub TEST_LINT,
13+
Warn,
14+
""
15+
}
16+
17+
declare_lint_pass!(Pass => [TEST_LINT]);
18+
19+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
20+
fn check_expr(&mut self, _cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
21+
let _ = expr.span.ctxt().outer_expn_data();
22+
}
23+
}
24+
25+
fn main() {}

tests/ui/outer_expn_data.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// run-rustfix
2+
13
#![deny(clippy::internal)]
24
#![feature(rustc_private)]
35

tests/ui/outer_expn_data.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: usage of `outer_expn().expn_data()`
2-
--> $DIR/outer_expn_data.rs:19:33
2+
--> $DIR/outer_expn_data.rs:21:33
33
|
44
LL | let _ = expr.span.ctxt().outer_expn().expn_data();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.outer_expn_data()`
66
|
77
note: lint level defined here
8-
--> $DIR/outer_expn_data.rs:1:9
8+
--> $DIR/outer_expn_data.rs:3:9
99
|
1010
LL | #![deny(clippy::internal)]
1111
| ^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)