1
Fork 0

Fix ICE for issue 2594

This commit is contained in:
Philipp Hansch 2018-05-13 13:16:31 +02:00
parent 21e783d3b6
commit 6eb07cc5b6
No known key found for this signature in database
GPG key ID: B6FA06A6E0E2665B
17 changed files with 42 additions and 35 deletions

View file

@ -138,7 +138,7 @@ fn str_span(base: Span, c: regex_syntax::ast::Span, offset: u16) -> Span {
}
fn const_str<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) -> Option<String> {
constant(cx, e).and_then(|(c, _)| match c {
constant(cx, cx.tables, e).and_then(|(c, _)| match c {
Constant::Str(s) => Some(s),
_ => None,
})