about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-07-15 19:55:10 -0400
committerGitHub <noreply@github.com>2019-07-15 19:55:10 -0400
commitf9576a6fce3a185ef6f61045a566f47c7bd54758 (patch)
treea4952f77b74dd0eb58ceb924a877ec6dae144983 /src/libsyntax/parse/parser.rs
parentaa480100b38c349aa0288f553911d498be8583ce (diff)
parent7111328556e0580f1323cde3d5193eb8d2767693 (diff)
downloadrust-f9576a6fce3a185ef6f61045a566f47c7bd54758.tar.gz
rust-f9576a6fce3a185ef6f61045a566f47c7bd54758.zip
Rollup merge of #62668 - goodmanjonathan:fix-62660, r=estebank
Fix #62660

If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE.

Fixes #62660.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 8968ca1793a..050b614d147 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1498,7 +1498,7 @@ impl<'a> Parser<'a> {
         F: Fn(&token::Token) -> bool
     {
         let attrs = self.parse_arg_attributes()?;
-        if let Ok(Some(mut arg)) = self.parse_self_arg() {
+        if let Some(mut arg) = self.parse_self_arg()? {
             arg.attrs = attrs.into();
             return self.recover_bad_self_arg(arg, is_trait_item);
         }