Skip to content

Commit 64ca751

Browse files
committed
Mention the type in the overflowing literal lint
Fixes #21807
1 parent 474b324 commit 64ca751

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/lint/builtin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ impl LintPass for TypeLimits {
227227
if (negative && v > (min.abs() as u64)) ||
228228
(!negative && v > (max.abs() as u64)) {
229229
cx.span_lint(OVERFLOWING_LITERALS, e.span,
230-
"literal out of range for its type");
230+
&*format!("literal out of range for {:?}", t));
231231
return;
232232
}
233233
}
@@ -246,7 +246,7 @@ impl LintPass for TypeLimits {
246246
};
247247
if lit_val < min || lit_val > max {
248248
cx.span_lint(OVERFLOWING_LITERALS, e.span,
249-
"literal out of range for its type");
249+
&*format!("literal out of range for {:?}", t));
250250
}
251251
},
252252
ty::ty_float(t) => {
@@ -263,7 +263,7 @@ impl LintPass for TypeLimits {
263263
};
264264
if lit_val < min || lit_val > max {
265265
cx.span_lint(OVERFLOWING_LITERALS, e.span,
266-
"literal out of range for its type");
266+
&*format!("literal out of range for {:?}", t));
267267
}
268268
},
269269
_ => ()

0 commit comments

Comments
 (0)