about summary refs log tree commit diff
path: root/src/librustc_parse/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-02-10 22:46:29 +0000
committerbors <bors@rust-lang.org>2020-02-10 22:46:29 +0000
commit0f0cdf6acdb5a9b968728d961929ca59ff93cfa4 (patch)
tree49bcf3b1fde98c8ed06da56145fafc574f47e60e /src/librustc_parse/parser
parente6ec0d125eba4074122b187032474b4174fb9d31 (diff)
parent119bc976db5549f17258a55bb9684eae0fa98b65 (diff)
downloadrust-0f0cdf6acdb5a9b968728d961929ca59ff93cfa4.tar.gz
rust-0f0cdf6acdb5a9b968728d961929ca59ff93cfa4.zip
Auto merge of #69030 - Dylan-DPC:rollup-t9uk7vc, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #68897 (clean up E0275 explanation)
 - #68908 (Add long error code explanation message for E0637 )
 - #68932 (self-profile: Support arguments for generic_activities.)
 - #68986 (Make ASCII ctype functions unstably const )
 - #69007 (Clean up E0283 explanation)
 - #69014 (change an instance of span_bug() to struct_span_err() to avoid ICE)

Failed merges:

r? @ghost
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)