Skip to content

Commit

Permalink
Expand (fix) u* and i* repr hints
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jun 6, 2018
1 parent 48e45ee commit 451eb66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,9 @@ impl EarlyLintPass for BadRepr {
let mut warn = if let Some(ref lit) = attr.value_str() {
// avoid warning about empty `repr` on `#[repr = "foo"]`
let sp = match format!("{}", lit).as_ref() {
"C" | "packed" | "rust" | "u*" | "i*" | "transparent" => {
| "C" | "packed" | "rust" | "transparent"
| "u8" | "u16" | "u32" | "u64" | "u128"
| "i8" | "i16" | "i32" | "i64" | "i128" => {
let lo = attr.span.lo() + BytePos(2);
let hi = attr.span.hi() - BytePos(1);
suggested = true;
Expand Down

0 comments on commit 451eb66

Please sign in to comment.