Skip to content

Commit f7fa2a8

Browse files
committed
Auto merge of #3811 - rust-lang:test-for-2526, r=flip1995
Add a test for #2526 Closes #2526, which seems to have been fixed at some point, but I couldn't find a test for it.
2 parents 5833e4d + 3a9426e commit f7fa2a8

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/ui/proc_macro.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//! Check that we correctly lint procedural macros.
2+
3+
#![crate_type = "proc-macro"]
4+
5+
#[allow(dead_code)]
6+
fn f() {
7+
let _x = 3.14;
8+
}
9+

tests/ui/proc_macro.stderr

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly
2+
--> $DIR/proc_macro.rs:7:14
3+
|
4+
LL | let _x = 3.14;
5+
| ^^^^
6+
|
7+
= note: #[deny(clippy::approx_constant)] on by default
8+
9+
error: aborting due to previous error
10+

0 commit comments

Comments
 (0)