Add a test for #2526

This commit is contained in:
mcarton 2019-02-24 15:59:58 +01:00
parent 68114c40cb
commit 8bcd546648
2 changed files with 18 additions and 0 deletions

8
tests/ui/proc_macro.rs Executable file
View file

@ -0,0 +1,8 @@
//! Check that we correctly lint procedural macros.
#![crate_type = "proc-macro"]
#[allow(dead_code)]
fn f() {
let _x = 3.14;
}

View file

@ -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