Fix hints from misc_early
This commit is contained in:
parent
5dbdfc1836
commit
9b78086ab3
|
@ -367,12 +367,12 @@ impl MiscEarly {
|
|||
db.span_suggestion(
|
||||
lit.span,
|
||||
"if you mean to use a decimal constant, remove the `0` to remove confusion",
|
||||
src.trim_left_matches('0').to_string(),
|
||||
src.trim_left_matches(|c| c == '_' || c == '0').to_string(),
|
||||
);
|
||||
db.span_suggestion(
|
||||
lit.span,
|
||||
"if you mean to use an octal constant, use `0o`",
|
||||
format!("0o{}", src.trim_left_matches('0')),
|
||||
format!("0o{}", src.trim_left_matches(|c| c == '_' || c == '0')),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -35,12 +35,12 @@ error: this is a decimal constant
|
|||
= note: `-D zero-prefixed-literal` implied by `-D warnings`
|
||||
help: if you mean to use a decimal constant, remove the `0` to remove confusion
|
||||
|
|
||||
17 | let fail_multi_zero = _123usize;
|
||||
| ^^^^^^^^^
|
||||
17 | let fail_multi_zero = 123usize;
|
||||
| ^^^^^^^^
|
||||
help: if you mean to use an octal constant, use `0o`
|
||||
|
|
||||
17 | let fail_multi_zero = 0o_123usize;
|
||||
| ^^^^^^^^^^^
|
||||
17 | let fail_multi_zero = 0o123usize;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: integer type suffix should be separated by an underscore
|
||||
--> literals.rs:22:17
|
||||
|
|
Loading…
Reference in New Issue