fixes #3151 by skipping the lint instead of crashing

This commit is contained in:
Pascal Seitz 2018-09-08 15:30:50 +02:00
parent fdd830f52c
commit 43549ebbf8
2 changed files with 19 additions and 3 deletions

View file

@ -1810,9 +1810,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitHasher {
let generics_suggestion_span = generics.span.substitute_dummy({
let pos = snippet_opt(cx, item.span.until(target.span()))
.and_then(|snip| Some(item.span.lo() + BytePos(snip.find("impl")? as u32 + 4)))
.expect("failed to create span for type arguments");
Span::new(pos, pos, item.span.data().ctxt)
.and_then(|snip| Some(item.span.lo() + BytePos(snip.find("impl")? as u32 + 4)));
if let Some(pos) = pos {
Span::new(pos, pos, item.span.data().ctxt)
}else{
return;
}
});
let mut ctr_vis = ImplicitHasherConstructorVisitor::new(cx, target);

View file

@ -0,0 +1,13 @@
#[derive(Clone)]
pub struct HashMap<V, S> {
hash_builder: S,
table: RawTable<V>,
}
#[derive(Clone)]
pub struct RawTable<V> {
size: usize,
val: V
}
fn main() {}