Added support for isize/usize in the CastPass lint pass.
Extracted the match that determines an integer types's size in a utility function and implemented support for usize/isize. Added a needed feature to the crate root. Added some tests to cover those cases, and a test I previously forgot. Silenced two errors signaled by dogfood.sh in unicode.rs.
This commit is contained in:
parent
dbc9b7f46e
commit
ad0bc66402
4 changed files with 46 additions and 20 deletions
|
|
@ -40,6 +40,7 @@ fn check_str(cx: &Context, string: &str, span: Span) {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(cast_possible_truncation)]
|
||||
fn str_pos_lint(cx: &Context, lint: &'static Lint, span: Span, index: usize, msg: &str) {
|
||||
span_lint(cx, lint, Span { lo: span.lo + BytePos((1 + index) as u32),
|
||||
hi: span.lo + BytePos((1 + index) as u32),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue