diff options
| author | bors <bors@rust-lang.org> | 2019-09-22 22:34:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-09-22 22:34:22 +0000 |
| commit | c0b7e71bec30753a1c4c387c8b14710b8674649f (patch) | |
| tree | 6b7e7eac12374942aacfb071b5d0cda2a70ba5ec /src/libsyntax/parse/parser | |
| parent | 1dd1884891636d0eb51157d137230076bcf20627 (diff) | |
| parent | ff75124a377f60ee4bd084ca2569e1530ff52856 (diff) | |
| download | rust-c0b7e71bec30753a1c4c387c8b14710b8674649f.tar.gz rust-c0b7e71bec30753a1c4c387c8b14710b8674649f.zip | |
Auto merge of #64151 - estebank:binding-error, r=varkor
On obligation errors point at the unfulfilled binding when possible CC #42855, #64130, #64135. Fix #61860.
Diffstat (limited to 'src/libsyntax/parse/parser')
| -rw-r--r-- | src/libsyntax/parse/parser/path.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libsyntax/parse/parser/path.rs b/src/libsyntax/parse/parser/path.rs index dcd3c648017..87839f8c70e 100644 --- a/src/libsyntax/parse/parser/path.rs +++ b/src/libsyntax/parse/parser/path.rs @@ -129,10 +129,11 @@ impl<'a> Parser<'a> { self.parse_path(style) } - crate fn parse_path_segments(&mut self, - segments: &mut Vec<PathSegment>, - style: PathStyle) - -> PResult<'a, ()> { + crate fn parse_path_segments( + &mut self, + segments: &mut Vec<PathSegment>, + style: PathStyle, + ) -> PResult<'a, ()> { loop { let segment = self.parse_path_segment(style)?; if style == PathStyle::Expr { @@ -201,7 +202,7 @@ impl<'a> Parser<'a> { } else { // `(T, U) -> R` let (inputs, _) = self.parse_paren_comma_seq(|p| p.parse_ty())?; - let span = lo.to(self.prev_span); + let span = ident.span.to(self.prev_span); let output = if self.eat(&token::RArrow) { Some(self.parse_ty_common(false, false, false)?) } else { |
