Dylan MacKenzie
d461e6d6cb
Use named fields for ast::ItemKind::Impl
2020-01-17 15:59:07 -08:00
Mazdak Farrokhzad
cacda2d7a0
Rollup merge of #68084 - estebank:ice-68000, r=varkor
...
Do not ICE on unicode next point
Use `shrink_to_hi` instead of `next_point` and fix `next_point`.
Fix #68000 , fix #68091 , fix #68092 .
2020-01-11 04:02:28 +01:00
Esteban Küber
b93ef68245
Change next_point when shrink_to_hi is more appropriate
2020-01-10 11:23:59 -08:00
Esteban Küber
fcd850fc5d
Do not ICE on unicode next point
...
Use `shrink_to_hi` instead of `next_point`
Fix #68000 .
2020-01-09 22:10:18 -08:00
Mazdak Farrokhzad
6f3f1c537b
Rollup merge of #68073 - Centril:fix-68062, r=estebank
...
expect `fn` after `const unsafe` / `const extern`
Fixes #68062
r? @estebank @petrochenkov
cc @Aaron1011
2020-01-10 02:47:36 +01:00
Mazdak Farrokhzad
2307f0c4ea
Rollup merge of #68071 - estebank:ice-67995, r=Centril
...
Extend support of `_` in type parameters
- Account for `impl Trait<_>`.
- Provide a reasonable `Span` for empty `Generics` in `impl`s.
- Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`.
- Fix #67995 . Follow up to #67597 .
2020-01-10 02:47:34 +01:00
Dylan MacKenzie
31edbe9aca
Reject const in inherent impls
2020-01-09 16:47:05 -08:00
Dylan MacKenzie
1c3fe9de4e
Parse impl const Trait for Ty syntax
2020-01-09 16:46:14 -08:00
Esteban Küber
c751961d29
Extend support of _ in type parameters
...
- Account for `impl Trait<_>`.
- Provide a reasonable `Span` for empty `Generics` in `impl`s.
- Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`.
- Fix #67995 .
2020-01-09 14:20:53 -08:00
Mazdak Farrokhzad
915db7ae64
expect fn after const unsafe / const extern
2020-01-09 23:02:34 +01:00
Mazdak Farrokhzad
2c3e5d3de0
- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}
...
- remove syntax::{help!, span_help!, span_note!}
- remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!}
- lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints
- inline syntax::{struct_span_warn!, diagnostic_used!}
- stringify_error_code! -> error_code! & use it more.
- find_plugin_registrar: de-fatalize an error
- de-fatalize metadata errors
- move type_error_struct! to rustc_typeck
- struct_span_err! -> rustc_errors
2020-01-08 04:25:33 +01:00
Vadim Petrochenkov
70f1d57048
Rename syntax_pos to rustc_span in source code
2020-01-01 09:15:18 +03:00
Mazdak Farrokhzad
13ca924988
parser::item: remove .fatal calls
2019-12-31 04:33:34 +01:00
Mazdak Farrokhzad
5a64ba6386
parser: span_fatal -> struct_span_err
2019-12-31 04:33:34 +01:00
Mazdak Farrokhzad
b6fc87c5b9
de-fatalize some errors
2019-12-31 04:33:34 +01:00
Mazdak Farrokhzad
2091062bf6
parser: call .struct_span_err directly
2019-12-31 04:33:34 +01:00
Mazdak Farrokhzad
8456c403e1
extract parse_not_expr
2019-12-23 13:55:04 +01:00
Mark Rousskov
a06baa56b9
Format the world
2019-12-22 17:42:47 -05:00
Mazdak Farrokhzad
616373e668
Rollup merge of #67148 - Centril:ty-polish, r=estebank
...
Refactor type & bounds parsing thoroughly
PR is based on https://github.com/rust-lang/rust/pull/67131 with first one from this PR being ` extract parse_ty_tuple_or_parens`.
Also fixes #67146 .
r? @estebank
2019-12-22 02:40:00 +01:00
Mazdak Farrokhzad
211560d05c
extract parse_array_or_slice_ty
2019-12-21 19:20:41 +01:00
Mazdak Farrokhzad
c0bf3afc96
Rollup merge of #67355 - Centril:merge-mut, r=oli-obk
...
Merge `ast::Mutability` and `mir::Mutability`
r? @oli-obk
2019-12-21 15:29:42 +01:00
Mazdak Farrokhzad
a0d20935cc
introduce 'type AttrVec'
2019-12-20 22:53:40 +01:00
Mazdak Farrokhzad
a7aec3f207
1. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.
...
2. mir::Mutability -> ast::Mutability.
2019-12-20 22:22:44 +01:00
Mazdak Farrokhzad
e52f902a8a
AssocImplKind::{Method -> Fn}.
2019-12-12 18:05:05 +01:00
Mazdak Farrokhzad
35e9e097e7
More c-variadic errors as semantic restrictions.
2019-12-12 18:01:33 +01:00
Mazdak Farrokhzad
0d41d0fe14
Move allow_c_varadic logic to ast_validation.
2019-12-12 18:01:33 +01:00
Mazdak Farrokhzad
51ccdebe0b
Unify associated item parsing more.
2019-12-12 18:00:00 +01:00
Mazdak Farrokhzad
34d91709b6
parse: refactor fun ret ty & param ty
2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
fa828d7a05
Relocate is_const_item.
2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
63a9030e7b
Unify associated item parsing.
...
An exception is `fn` params.
2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
7672bff378
Unify associated function parsing.
2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
10270bcd30
Fuse associated type parsing.
2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
2d92aa5535
Fuse associated constant parsing.
2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
39073767a4
Unify {Trait,Impl}ItemKind::TyAlias structures.
2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
c02fd31302
TraitItemKind::Type -> TraitItemKind::TyAlias.
2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
f6403c6c76
Use Option in ImplItemKind::Method.
2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
73557faed2
Use Option in ImplItemKind::Const.
2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
c4bbe9cbbe
Alias TraitItem & ImplItem.
...
Allow defaultness on trait items syntactically.
2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
c8850c7144
Make ForeignItem an alias of Item.
2019-12-07 06:05:25 +01:00
Kamlesh Kumar
f8ecf04f4b
accept union inside enum if not followed by identifier
2019-12-06 10:52:28 +05:30
Mazdak Farrokhzad
74804fa3e7
rustc_parser: cleanup imports
2019-12-05 06:38:06 +01:00
Mazdak Farrokhzad
d4b623547f
Rollup merge of #66903 - Centril:parse-enum-variant, r=estebank
...
parse_enum_item -> parse_enum_variant
r? @estebank
2019-12-03 19:41:51 +01:00
Vadim Petrochenkov
537895535d
syntax: Use ast::MacArgs for macro definitions
2019-12-02 21:56:34 +03:00
Vadim Petrochenkov
0fac56717a
syntax: Remove redundant span from ast::Mac
...
Also remove a couple of redundant `visit_mac` asserts
2019-12-02 21:56:34 +03:00
Vadim Petrochenkov
a81804b4d5
syntax: Introduce a struct MacArgs for macro arguments
2019-12-02 21:56:34 +03:00
Mazdak Farrokhzad
cb08677869
parse_enum_item -> parse_enum_variant
2019-11-30 14:55:05 +01:00
Tyler Mandry
999fd561ba
Rollup merge of #66798 - bwignall:typo, r=varkor
...
Fix spelling typos
Should be non-semantic.
Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos.
2019-11-27 15:28:53 -06:00
Tyler Mandry
71f20b89ef
Rollup merge of #66718 - VirrageS:use_comma, r=Centril
...
Refactor `parse_enum_item` to use `parse_delim_comma_seq`
Followup after https://github.com/rust-lang/rust/pull/66641
Some errors got more verbose but I think they make sense with the help message.
2019-11-27 15:28:40 -06:00
Brian Wignall
16fabd8efd
Fix spelling typos
2019-11-26 22:19:54 -05:00
Tyler Mandry
bb6236cd74
Rollup merge of #66754 - estebank:rustdoc-capitalization, r=Dylan-DPC
...
Various tweaks to diagnostic output
2019-11-26 17:56:19 -06:00