about summary refs log tree commit diff
path: root/src/librustc_parse/parser/item.rs
AgeCommit message (Collapse)AuthorLines
2019-12-12Unify associated item parsing more.Mazdak Farrokhzad-29/+20
2019-12-12parse: refactor fun ret ty & param tyMazdak Farrokhzad-3/+3
2019-12-12Relocate `is_const_item`.Mazdak Farrokhzad-7/+7
2019-12-12Unify associated item parsing.Mazdak Farrokhzad-50/+20
An exception is `fn` params.
2019-12-12Unify associated function parsing.Mazdak Farrokhzad-42/+23
2019-12-12Fuse associated type parsing.Mazdak Farrokhzad-29/+4
2019-12-12Fuse associated constant parsing.Mazdak Farrokhzad-20/+8
2019-12-12Unify `{Trait,Impl}ItemKind::TyAlias` structures.Mazdak Farrokhzad-3/+27
2019-12-12`TraitItemKind::Type` -> `TraitItemKind::TyAlias`.Mazdak Farrokhzad-1/+1
2019-12-12Use `Option` in `ImplItemKind::Method`.Mazdak Farrokhzad-7/+5
2019-12-12Use `Option` in `ImplItemKind::Const`.Mazdak Farrokhzad-7/+10
2019-12-12Alias `TraitItem` & `ImplItem`.Mazdak Farrokhzad-2/+4
Allow defaultness on trait items syntactically.
2019-12-07Make `ForeignItem` an alias of `Item`.Mazdak Farrokhzad-1/+5
2019-12-06accept union inside enum if not followed by identifierKamlesh Kumar-2/+3
2019-12-05rustc_parser: cleanup importsMazdak Farrokhzad-4/+3
2019-12-03Rollup merge of #66903 - Centril:parse-enum-variant, r=estebankMazdak Farrokhzad-2/+2
parse_enum_item -> parse_enum_variant r? @estebank
2019-12-02syntax: Use `ast::MacArgs` for macro definitionsVadim Petrochenkov-21/+19
2019-12-02syntax: Remove redundant span from `ast::Mac`Vadim Petrochenkov-5/+0
Also remove a couple of redundant `visit_mac` asserts
2019-12-02syntax: Introduce a struct `MacArgs` for macro argumentsVadim Petrochenkov-12/+10
2019-11-30parse_enum_item -> parse_enum_variantMazdak Farrokhzad-2/+2
2019-11-27Rollup merge of #66798 - bwignall:typo, r=varkorTyler Mandry-1/+1
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-27Rollup merge of #66718 - VirrageS:use_comma, r=CentrilTyler Mandry-68/+47
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-26Fix spelling typosBrian Wignall-1/+1
2019-11-26Rollup merge of #66754 - estebank:rustdoc-capitalization, r=Dylan-DPCTyler Mandry-6/+11
Various tweaks to diagnostic output
2019-11-26Refactor 'parse_enum_item' to use 'parse_delim_comma_seq'Janusz Marcinkiewicz-68/+47
2019-11-25Various cleanupsEsteban Küber-6/+11
2019-11-23Add FIXME for using 'parse_delim_comma_seq' when parsing enum variantsJanusz Marcinkiewicz-0/+2
2019-11-23Cleanup code after review fixesJanusz Marcinkiewicz-14/+11
2019-11-23Add error reporting on nested keywords inside 'enum' definitionJanusz Marcinkiewicz-1/+36
2019-11-22Rollup merge of #66183 - Centril:empty-vis-trait-decl, r=petrochenkovMazdak Farrokhzad-8/+10
*Syntactically* permit visibilities on trait items & enum variants Fixes #65041 Suppose we have `$vis trait_item` or `$vis enum_variant` and `$vis` is a `:vis` macro fragment. Before this PR, this would fail to parse. This is now instead allowed as per language team consensus in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286. (See added tests for elaboration.) Moreover, we now also permit visibility modifiers on trait items & enum variants *syntactically* but reject them with semantic checks (in `ast_validation`): ```rust #[cfg(FALSE)] trait Foo { pub fn bar(); } // OK #[cfg(FALSE)] enum E { pub U } // OK ```
2019-11-16parse: Use string literal parsing in the `asm` macroVadim Petrochenkov-3/+3
2019-11-16parse: Support parsing optional literalsVadim Petrochenkov-1/+1
Revert weird renaming of the former `LitError::report`
2019-11-16ast: Keep string literals in ABIs preciselyVadim Petrochenkov-2/+2
2019-11-16ast: Keep `extern` qualifiers in functions more preciselyVadim Petrochenkov-14/+21
2019-11-15Rollup merge of #66197 - Centril:transparent-ast, r=varkorTyler Mandry-48/+13
Push `ast::{ItemKind, ImplItemKind}::OpaqueTy` hack down into lowering We currently have a hack in the form of `ast::{ItemKind, ImplItemKind}::OpaqueTy` which is constructed literally when you write `type Alias = impl Trait;` but not e.g. `type Alias = Vec<impl Trait>;`. Per https://github.com/rust-lang/rfcs/pull/2515, this needs to change to allow `impl Trait` in nested positions. This PR achieves this change for the syntactic aspect but not the semantic one, which will require changes in lowering and def collection. In the interim, `TyKind::opaque_top_hack` is introduced to avoid knock-on changes in lowering, collection, and resolve. These hacks can then be removed and fixed one by one until the desired semantics are supported. r? @varkor
2019-11-14TAIT: parse recursively instead of hack.Mazdak Farrokhzad-48/+13
2019-11-14Clean some error codes diagnosticsGuillaume Gomez-3/+7
2019-11-11fix an ICE in macro's diagnostic messageGuanqun Lu-2/+13
2019-11-11syntactically allow visibility on trait item & enum variantMazdak Farrokhzad-8/+10
2019-11-10move syntax::parse -> librustc_parseMazdak Farrokhzad-0/+2238
also move MACRO_ARGUMENTS -> librustc_parse