We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2510fd commit 3e0a5b9Copy full SHA for 3e0a5b9
src/libsyntax/parse/parser.rs
@@ -1050,11 +1050,13 @@ impl Parser {
1050
// Like the above, but can also parse kind bounds in the case of a
1051
// path to be used as a type that might be a trait.
1052
pub fn parse_type_path(&self) -> (@ast::Path, OptVec<TyParamBound>) {
1053
- let mut bounds = None;
+ let mut bounds = opt_vec::Empty;
1054
let path = self.parse_bounded_path_with_tps(false, Some(|| {
1055
- bounds = Some(self.parse_optional_ty_param_bounds());
+ // Note: this closure might not even get called in the case of a
1056
+ // macro-generated path. But that's the macro parser's job.
1057
+ bounds = self.parse_optional_ty_param_bounds();
1058
}));
- (path, bounds.unwrap())
1059
+ (path, bounds)
1060
}
1061
1062
/// parses 0 or 1 lifetime
0 commit comments