summary refs log tree commit diff
path: root/src/librustc_parse/parser
diff options
context:
space:
mode:
authorDavid Renshaw <dwrenshaw@gmail.com>2020-02-09 23:01:23 -0500
committerDavid Renshaw <dwrenshaw@gmail.com>2020-02-09 23:02:02 -0500
commit371060b5988158fdaa3b7abd6167a28d95d74b38 (patch)
treec035a26f3179b2bc9d0a6bd1eb9a6bb718bc80ad /src/librustc_parse/parser
parent840bdc349d2885a5173269b653025192969cfebc (diff)
downloadrust-371060b5988158fdaa3b7abd6167a28d95d74b38.tar.gz
rust-371060b5988158fdaa3b7abd6167a28d95d74b38.zip
[parser] change an instance of span_bug() to struct_span_err() to avoid ICE
Diffstat (limited to 'src/librustc_parse/parser')
-rw-r--r--src/librustc_parse/parser/ty.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_parse/parser/ty.rs b/src/librustc_parse/parser/ty.rs
index 990661bf6b5..a573a1ee699 100644
--- a/src/librustc_parse/parser/ty.rs
+++ b/src/librustc_parse/parser/ty.rs
@@ -214,7 +214,10 @@ impl<'a> Parser<'a> {
                     let path = match bounds.remove(0) {
                         GenericBound::Trait(pt, ..) => pt.trait_ref.path,
                         GenericBound::Outlives(..) => {
-                            self.span_bug(ty.span, "unexpected lifetime bound")
+                            return Err(self.struct_span_err(
+                                ty.span,
+                                "expected trait bound, not lifetime bound",
+                            ));
                         }
                     };
                     self.parse_remaining_bounds(Vec::new(), path, lo, true)