diff options
| author | bors <bors@rust-lang.org> | 2018-12-03 15:44:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-12-03 15:44:43 +0000 |
| commit | 0c999ed132d67bf2520643e9bd619972cf3888ba (patch) | |
| tree | e9dfee00ab60ea6aaa3fb48c0867fe4d5db3cf1e /src/libsyntax/parse/parser.rs | |
| parent | 9cd3bef4cfaaac2a608682d4b0834cda344249e0 (diff) | |
| parent | ac363d8793a1c6b69822a583e6f7d0b2f9904c86 (diff) | |
| download | rust-0c999ed132d67bf2520643e9bd619972cf3888ba.tar.gz rust-0c999ed132d67bf2520643e9bd619972cf3888ba.zip | |
Auto merge of #56451 - kennytm:rollup, r=kennytm
Rollup of 13 pull requests Successful merges: - #56141 ([std] Osstr len clarity) - #56366 (Stabilize self_in_typedefs feature) - #56395 (Stabilize dbg!(...)) - #56401 (Move VecDeque::resize_with out of the impl<T:Clone> block) - #56402 (Improve the unstable book example for #[marker] trait) - #56412 (Update tracking issue for `extern_crate_self`) - #56416 (Remove unneeded body class selector) - #56418 (Fix failing tidy (line endings on Windows)) - #56419 (Remove some uses of try!) - #56432 (Update issue number of `shrink_to` methods to point the tracking issue) - #56433 (Add description about `crate` for parse_visibility's comment) - #56435 (make the C part of compiler-builtins opt-out) - #56438 (Remove not used `DotEq` token) Failed merges: r? @ghost
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 33715f206de..1cd5006f330 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3145,7 +3145,7 @@ impl<'a> Parser<'a> { RangeLimits::Closed }; - let r = try!(self.mk_range(Some(lhs), rhs, limits)); + let r = self.mk_range(Some(lhs), rhs, limits)?; lhs = self.mk_expr(lhs_span.to(rhs_span), r, ThinVec::new()); break } @@ -3353,9 +3353,7 @@ impl<'a> Parser<'a> { RangeLimits::Closed }; - let r = try!(self.mk_range(None, - opt_end, - limits)); + let r = self.mk_range(None, opt_end, limits)?; Ok(self.mk_expr(lo.to(hi), r, attrs)) } @@ -6282,9 +6280,10 @@ impl<'a> Parser<'a> { self.parse_single_struct_field(lo, vis, attrs) } - /// Parse `pub`, `pub(crate)` and `pub(in path)` plus shortcuts `pub(self)` for `pub(in self)` - /// 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 + /// Parse `pub`, `pub(crate)` and `pub(in path)` plus shortcuts `crate` for `pub(crate)`, + /// `pub(self)` for `pub(in self)` 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. pub fn parse_visibility(&mut self, can_take_tuple: bool) -> PResult<'a, Visibility> { maybe_whole!(self, NtVis, |x| x); |
