Simplify span usage and avoid .eat()
This commit is contained in:
parent
3c91bdca1d
commit
88d64a0931
1 changed files with 5 additions and 5 deletions
|
@ -71,15 +71,15 @@ impl<'a> Parser<'a> {
|
||||||
debug!("parse_qpath: (decrement) count={:?}", self.unmatched_angle_bracket_count);
|
debug!("parse_qpath: (decrement) count={:?}", self.unmatched_angle_bracket_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
let lo_colon = self.token.span;
|
if self.token.kind == token::Colon {
|
||||||
if self.eat(&token::Colon) {
|
|
||||||
// <Bar as Baz<T>>:Qux
|
// <Bar as Baz<T>>:Qux
|
||||||
// ^
|
// ^
|
||||||
let span = lo_colon.to(self.prev_span);
|
self.bump();
|
||||||
|
|
||||||
self.diagnostic()
|
self.diagnostic()
|
||||||
.struct_span_err(span, "found single colon where type path was expected")
|
.struct_span_err(self.prev_span, "found single colon where type path was expected")
|
||||||
.span_suggestion(
|
.span_suggestion(
|
||||||
span,
|
self.prev_span,
|
||||||
"use double colon",
|
"use double colon",
|
||||||
"::".to_string(),
|
"::".to_string(),
|
||||||
Applicability::MachineApplicable,
|
Applicability::MachineApplicable,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue