about summary refs log tree commit diff
path: root/tests/ui-internal/outer_expn_data.fixed
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-11-08 13:39:46 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-11-29 21:07:43 +0100
commit2838b044875b84bb9dc515ba3aa0c1b9772d870b (patch)
treec7e5a7369e97b4231b738e2efb64832535cc107d /tests/ui-internal/outer_expn_data.fixed
parent68cf94f6a66e47234e3adefc6dfbe806cd6ad164 (diff)
add internal-lints feature to enable clippys internal lints (off by default)
Diffstat (limited to 'tests/ui-internal/outer_expn_data.fixed')
-rw-r--r--tests/ui-internal/outer_expn_data.fixed28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ui-internal/outer_expn_data.fixed b/tests/ui-internal/outer_expn_data.fixed
new file mode 100644
index 00000000000..b0b3498f057
--- /dev/null
+++ b/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() {}