From 8bcd546648d9ed16659d571380f41f3fbf7e0a47 Mon Sep 17 00:00:00 2001 From: mcarton Date: Sun, 24 Feb 2019 15:59:58 +0100 Subject: [PATCH] Add a test for #2526 --- tests/ui/proc_macro.rs | 8 ++++++++ tests/ui/proc_macro.stderr | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100755 tests/ui/proc_macro.rs create mode 100644 tests/ui/proc_macro.stderr diff --git a/tests/ui/proc_macro.rs b/tests/ui/proc_macro.rs new file mode 100755 index 00000000000..dd8bd58c015 --- /dev/null +++ b/tests/ui/proc_macro.rs @@ -0,0 +1,8 @@ +//! Check that we correctly lint procedural macros. + +#![crate_type = "proc-macro"] + +#[allow(dead_code)] +fn f() { + let _x = 3.14; +} diff --git a/tests/ui/proc_macro.stderr b/tests/ui/proc_macro.stderr new file mode 100644 index 00000000000..ec19cd8fc5f --- /dev/null +++ b/tests/ui/proc_macro.stderr @@ -0,0 +1,10 @@ +error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly + --> $DIR/proc_macro.rs:7:14 + | +LL | let _x = 3.14; + | ^^^^ + | + = note: #[deny(clippy::approx_constant)] on by default + +error: aborting due to previous error +