mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Merge pull request #3152 from PSeitz/master
fixes #3151 by skipping the lint instead of crashing
This commit is contained in:
commit
1c1030f83f
@ -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);
|
||||
|
13
tests/run-pass/ice-3151.rs
Normal file
13
tests/run-pass/ice-3151.rs
Normal 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() {}
|
Loading…
Reference in New Issue
Block a user