Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2bd28d9
Add regression tests
TommasoBianchi Nov 24, 2019
042d855
Fix too restrictive checks on Drop impls
TommasoBianchi Dec 16, 2019
b08d697
Formatting fixes
TommasoBianchi Dec 16, 2019
020be74
Clean up E0120 long explanation
GuillaumeGomez Dec 19, 2019
94d207f
Clean up E0121 long explanation
GuillaumeGomez Dec 19, 2019
7f0741d
Update E0120.md
Dylan-DPC Dec 20, 2019
dce0f06
Update E0121.md
Dylan-DPC Dec 20, 2019
963f20d
Allow -Cllvm-args to override rustc's default LLVM args.
michaelwoerister Dec 18, 2019
1ca145c
Remove rarely used -Zdisable_instrumentation_preinliner flag.
michaelwoerister Dec 18, 2019
382d370
Make ptr::slice_from_raw_parts a const fn available under a feature flag
Dec 20, 2019
c59588f
extract parse_ty_tuple_or_parens
Centril Dec 8, 2019
e68db0a
refactor parse_ty_tuple_or_parens
Centril Dec 8, 2019
6d678b1
parse_ptr -> parse_ty_ptr & refactor
Centril Dec 8, 2019
f085637
extract parse_array_or_slice_ty
Centril Dec 8, 2019
b42b85f
extract parse_typeof_ty
Centril Dec 8, 2019
d47de3e
extract parse_impl_ty
Centril Dec 8, 2019
1fa8f70
extract parse_dyn_ty
Centril Dec 8, 2019
c0561cf
extract parse_path_start_ty
Centril Dec 8, 2019
6b92be2
extract error_illegal_c_variadic_ty
Centril Dec 8, 2019
0e74022
parse_ty_common: .fatal -> .struct_span_err
Centril Dec 8, 2019
3b63465
parser/ty.rs: minor formatting tweaks
Centril Dec 8, 2019
8e8ac02
extract error_opt_out_lifetime
Centril Dec 8, 2019
56b54fb
extract recover_paren_lifetime
Centril Dec 8, 2019
e8b6769
parse_generic_bounds_common: dedent
Centril Dec 8, 2019
7294804
extract can_begin_bound
Centril Dec 8, 2019
229560b
extract parse_generic_bound
Centril Dec 8, 2019
2ca6181
functionalize parse_generic_bound
Centril Dec 8, 2019
f87ff0f
parse_generic_bound: leave a FIXME
Centril Dec 8, 2019
8f33bdc
extract parse_generic_ty_bound
Centril Dec 8, 2019
8123211
extract parse_generic_lt_bound
Centril Dec 8, 2019
90f7d8b
simplify negative bound diagnostic
Centril Dec 8, 2019
765df3a
simplify 'let question = ...;'
Centril Dec 8, 2019
51bbdeb
parse_generic_bounds: account for negative lifetime bounds
Centril Dec 8, 2019
f02fd50
extract error_negative_bounds
Centril Dec 8, 2019
0ebd421
document parse_late_bound_lifetime_defs
Centril Dec 8, 2019
d977e5b
parse_ty_bare_fn: improve docs
Centril Dec 8, 2019
cabe665
unwrap -> expect
Centril Dec 21, 2019
690b0b3
span_suggestion_hidden -> tool_only_span_suggestion
Centril Dec 21, 2019
abb4234
Rollup merge of #67059 - TommasoBianchi:dropck_fix_pr, r=pnkfelix
Centril Dec 21, 2019
2e44898
Rollup merge of #67148 - Centril:ty-polish, r=estebank
Centril Dec 21, 2019
97d88ed
Rollup merge of #67393 - michaelwoerister:llvm-args-override, r=varkor
Centril Dec 21, 2019
dfe712c
Rollup merge of #67422 - GuillaumeGomez:cleanup-err-codes, r=Dylan-DPC
Centril Dec 21, 2019
a3cc9b4
Rollup merge of #67462 - DutchGhost:const_slice_from_raw_parts, r=dto…
Centril Dec 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
parser/ty.rs: minor formatting tweaks
  • Loading branch information
Centril committed Dec 20, 2019
commit 3b63465f546a7e8c66055595442dc3dc47341a8c
35 changes: 23 additions & 12 deletions src/librustc_parse/parser/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,13 @@ impl<'a> Parser<'a> {
}
}

fn parse_remaining_bounds(&mut self, generic_params: Vec<GenericParam>, path: ast::Path,
lo: Span, parse_plus: bool) -> PResult<'a, TyKind> {
fn parse_remaining_bounds(
&mut self,
generic_params: Vec<GenericParam>,
path: ast::Path,
lo: Span,
parse_plus: bool,
) -> PResult<'a, TyKind> {
let poly_trait_ref = PolyTraitRef::new(generic_params, path, lo.to(self.prev_span));
let mut bounds = vec![GenericBound::Trait(poly_trait_ref, TraitBoundModifier::None)];
if parse_plus {
Expand Down Expand Up @@ -338,8 +343,10 @@ impl<'a> Parser<'a> {
.emit();
}

pub(super) fn parse_generic_bounds(&mut self,
colon_span: Option<Span>) -> PResult<'a, GenericBounds> {
pub(super) fn parse_generic_bounds(
&mut self,
colon_span: Option<Span>,
) -> PResult<'a, GenericBounds> {
self.parse_generic_bounds_common(true, colon_span)
}

Expand All @@ -351,20 +358,24 @@ impl<'a> Parser<'a> {
/// TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN)
/// TY_BOUND_NOPAREN = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g., `?for<'a: 'b> m::Trait<'a>`)
/// ```
fn parse_generic_bounds_common(&mut self,
allow_plus: bool,
colon_span: Option<Span>) -> PResult<'a, GenericBounds> {
fn parse_generic_bounds_common(
&mut self,
allow_plus: bool,
colon_span: Option<Span>,
) -> PResult<'a, GenericBounds> {
let mut bounds = Vec::new();
let mut negative_bounds = Vec::new();
let mut last_plus_span = None;
let mut was_negative = false;
loop {
// This needs to be synchronized with `TokenKind::can_begin_bound`.
let is_bound_start = self.check_path() || self.check_lifetime() ||
self.check(&token::Not) || // used for error reporting only
self.check(&token::Question) ||
self.check_keyword(kw::For) ||
self.check(&token::OpenDelim(token::Paren));
let is_bound_start = self.check_path()
|| self.check_lifetime()
|| self.check(&token::Not) // Used for error reporting only.
|| self.check(&token::Question)
|| self.check_keyword(kw::For)
|| self.check(&token::OpenDelim(token::Paren));

if is_bound_start {
let lo = self.token.span;
let has_parens = self.eat(&token::OpenDelim(token::Paren));
Expand Down