We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 255468e commit ca4eb90Copy full SHA for ca4eb90
src/libsyntax/parse/parser.rs
@@ -2039,6 +2039,14 @@ impl<'a> Parser<'a> {
2039
Ok(if style == PathStyle::Type && check_args_start(self, true)
2040
|| style != PathStyle::Mod && self.check(&token::ModSep)
2041
&& self.look_ahead(1, |t| is_args_start(t, true))
2042
+ && {
2043
+ if style == PathStyle::Expr {
2044
+ // Simulate every occurrence of `::<>` actually being `<>`.
2045
+ self.eat(&token::ModSep);
2046
+ parser_snapshot_before_generics = Some(self.clone());
2047
+ }
2048
+ true
2049
2050
|| style == PathStyle::Expr && check_args_start(self, false) && {
2051
// Check for generic arguments in an expression without a disambiguating `::`.
2052
// We have to save a snapshot, because it could end up being an expression
0 commit comments