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:
R.Chavignat 2015-08-21 03:03:37 +02:00
parent dbc9b7f46e
commit ad0bc66402
4 changed files with 46 additions and 20 deletions

View file

@ -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),