}).emit();
}
- // Parse bounds of a type parameter `BOUND + BOUND + BOUND` without trailing `+`.
+ // Parse bounds of a type parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
// BOUND = TY_BOUND | LT_BOUND
// LT_BOUND = LIFETIME (e.g. `'a`)
// TY_BOUND = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'a>`)
self.parse_ty_param_bounds_common(true)
}
- // Parse bounds of a type parameter `BOUND + BOUND + BOUND` without trailing `+`.
+ // Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
// BOUND = LT_BOUND (e.g. `'a`)
fn parse_lt_param_bounds(&mut self) -> Vec<Lifetime> {
let mut lifetimes = Vec::new();
/// and `pub(super)` for `pub(in super)`. If the following element can't be a tuple (i.e. it's
/// a function definition, it's not a tuple struct field) and the contents within the parens
/// isn't valid, emit a proper diagnostic.
- fn parse_visibility(&mut self, can_take_tuple: bool) -> PResult<'a, Visibility> {
+ pub fn parse_visibility(&mut self, can_take_tuple: bool) -> PResult<'a, Visibility> {
+ maybe_whole!(self, NtVis, |x| x);
+
if !self.eat_keyword(keywords::Pub) {
return Ok(Visibility::Inherited)
}