about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui-internal/outer_expn_data.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui-internal/outer_expn_data.fixed')
-rw-r--r--src/tools/clippy/tests/ui-internal/outer_expn_data.fixed28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui-internal/outer_expn_data.fixed b/src/tools/clippy/tests/ui-internal/outer_expn_data.fixed
new file mode 100644
index 00000000000..b0b3498f057
--- /dev/null
+++ b/src/tools/clippy/tests/ui-internal/outer_expn_data.fixed
@@ -0,0 +1,28 @@
+// run-rustfix
+
+#![deny(clippy::internal)]
+#![feature(rustc_private)]
+
+extern crate rustc_hir;
+extern crate rustc_lint;
+extern crate rustc_middle;
+#[macro_use]
+extern crate rustc_session;
+use rustc_hir::Expr;
+use rustc_lint::{LateContext, LateLintPass};
+
+declare_lint! {
+    pub TEST_LINT,
+    Warn,
+    ""
+}
+
+declare_lint_pass!(Pass => [TEST_LINT]);
+
+impl<'tcx> LateLintPass<'tcx> for Pass {
+    fn check_expr(&mut self, _cx: &LateContext<'tcx>, expr: &'tcx Expr) {
+        let _ = expr.span.ctxt().outer_expn_data();
+    }
+}
+
+fn main() {}