Skip to content

Commit 667da4e

Browse files
committed
Add more regression tests
1 parent 44e9e54 commit 667da4e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

clippy_lints/src/misc_early.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,6 @@ impl EarlyLintPass for MiscEarlyLints {
390390

391391
impl MiscEarlyLints {
392392
fn check_lit(self, cx: &EarlyContext<'_>, lit: &Lit) {
393-
if in_external_macro(cx.sess(), lit.span) {
394-
return;
395-
}
396-
397393
if let LitKind::Int(value, lit_int_type) = lit.node {
398394
if let Some(src) = snippet_opt(cx, lit.span) {
399395
let suffix = match lit_int_type {

tests/ui/unseparated_prefix_literals.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#![warn(clippy::unseparated_literal_suffix)]
44
#![allow(dead_code)]
55

6+
macro_rules! lit_from_macro {
7+
() => {42};
8+
}
9+
610
fn main() {
711
let _ok1 = 1234_i32;
812
let _ok2 = 1234_isize;
@@ -17,4 +21,8 @@ fn main() {
1721
let _okf2 = 1_f32;
1822
let _failf1 = 1.5f32;
1923
let _failf2 = 1f32;
24+
25+
// Counter example
26+
let _ = line!();
27+
let _ = lit_from_macro!();
2028
}

0 commit comments

Comments
 (0)