about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-08-12Rollup merge of #63449 - petrochenkov:builtinagain, r=eddybMazdak Farrokhzad-3/+3
resolve: Remove remaining special cases from built-in macros Edition and definition sites of the macros are now also taken from the `#[rustc_builtin_macro]` definitions in `libcore`. --- The edition switch may be a breaking change for `Rustc{Encodable,Decodable}` derives if they are used in combination with the unstable crate `serialize` from sysroot like this ```rust extern crate serialize; use serialize as rustc_serialize; #[derive(RustcEncodable)] struct S; ``` (see the updated `ui-fulldeps` tests).
2019-08-11parser: {check,expect}_lifetime into ty.rsMazdak Farrokhzad-19/+19
2019-08-11parser: move into generics.rsMazdak Farrokhzad-272/+278
2019-08-11parser: move into stmt.rsMazdak Farrokhzad-464/+477
2019-08-11parser: move parse_fn_block_decl into expr.rsMazdak Farrokhzad-60/+56
2019-08-11parser: move parse_ident_or_underscore into item.rsMazdak Farrokhzad-11/+11
2019-08-11parser: split into {ty, path}.rsMazdak Farrokhzad-899/+930
2019-08-11parser: split into {item,module}.rsMazdak Farrokhzad-2218/+2251
2019-08-11parser: split into pat.rsMazdak Farrokhzad-633/+642
2019-08-11parser: split into expr.rsMazdak Farrokhzad-1667/+1712
2019-08-10resolve: Remove remaining special cases from built-in macrosVadim Petrochenkov-3/+3
2019-08-10Rollup merge of #63399 - estebank:vec-in-pat, r=CentrilMazdak Farrokhzad-7/+48
More explicit diagnostic when using a `vec![]` in a pattern ``` error: unexpected `(` after qualified path --> $DIR/vec-macro-in-pattern.rs:3:14 | LL | Some(vec![x]) => (), | ^^^^^^^ | | | unexpected `(` after qualified path | in this macro invocation | use a slice pattern here instead | = help: for more information, see https://doc.rust-lang.org/edition-guide/rust-2018/slice-patterns.html = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) ``` Fix #61933.
2019-08-09review comments: use structured suggestionEsteban Küber-34/+36
2019-08-09More explicit diagnostic when using a `vec![]` in a patternEsteban Küber-6/+45
``` error: unexpected `(` after qualified path --> $DIR/vec-macro-in-pattern.rs:3:14 | LL | Some(vec![x]) => (), | ^^^^^^^ | | | unexpected `(` after qualified path | in this macro invocation | use a slice pattern here instead | = help: for more information, see https://doc.rust-lang.org/edition-guide/rust-2018/slice-patterns.html = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) ```
2019-08-09Recover parser from `foo(_, _)`Esteban Küber-20/+50
2019-08-08reduce visibilityAleksey Kladov-2/+2
2019-08-06Rollup merge of #63285 - Mark-Simulacrum:rm-await-origin, r=CentrilMazdak Farrokhzad-9/+0
Remove leftover AwaitOrigin This was missed in PR #62293.
2019-08-06Rollup merge of #63272 - Mark-Simulacrum:clean-attr, r=petrochenkovMazdak Farrokhzad-13/+12
Some more libsyntax::attr cleanup Much smaller patch than the last one, mostly just finishing up by removing some Span arguments. r? @petrochenkov
2019-08-05Remove leftover AwaitOriginMark Rousskov-9/+0
This was missed in PR #62293.
2019-08-05Make mk_attr_id private to libsyntaxMark Rousskov-1/+1
2019-08-05Drop explicit span argument from mk_name_value_itemMark Rousskov-4/+4
2019-08-05Drop span argument from mk_list_itemMark Rousskov-8/+7
2019-08-05add unknown tokenAleksey Kladov-4/+7
2019-08-05remove special code path for unknown tokensAleksey Kladov-60/+13
2019-08-05Auto merge of #63248 - petrochenkov:nomarker, r=matthewjasperbors-56/+26
Move special treatment of `derive(Copy, PartialEq, Eq)` from expansion infrastructure to elsewhere As described in https://github.com/rust-lang/rust/pull/62086#issuecomment-515195477. Reminder: - `derive(PartialEq, Eq)` makes the type it applied to a "structural match" type, so constants of this type can be used in patterns (and const generics in the future). - `derive(Copy)` notifies other derives that the type it applied to implements `Copy`, so `derive(Clone)` can generate optimized code and other derives can generate code working with `packed` types and types with `rustc_layout_scalar_valid_range` attributes. First, the special behavior is now enabled after properly resolving the derives, rather than after textually comparing them with `"Copy"`, `"PartialEq"` and `"Eq"` in `fn add_derived_markers`. The markers are no longer kept as attributes in AST since derives cannot modify items and previously did it through hacks in the expansion infra. Instead, the markers are now kept in a "global context" available from all the necessary places, namely - resolver. For `derive(PartialEq, Eq)` the markers are created by the derive macros themselves and then consumed during HIR lowering to add the `#[structural_match]` attribute in HIR. This is still a hack, but now it's a hack local to two specific macros rather than affecting the whole expansion infra. Ideally we should find the way to put `#[structural_match]` on the impls rather than on the original item, and then consume it in `rustc_mir`, then no hacks in expansion and lowering will be required. (I'll make an issue about this for someone else to solve, after this PR lands.) The marker for `derive(Copy)` cannot be emitted by the `Copy` macro itself because we need to know it *before* the `Copy` macro is expanded for expanding other macros. So we have to do it in resolve and block expansion of any derives in a `derive(...)` container until we know for sure whether this container has `Copy` in it or not. Nasty stuff. r? @eddyb or @matthewjasper
2019-08-04Auto merge of #63213 - varkor:itemkind-tyalias, r=Centrilbors-13/+13
Rename `ItemKind::Ty` to `ItemKind::TyAlias` The current name is not entirely clear without context and `TyAlias` is consistent with `ItemKind::TraitAlias`.
2019-08-04Rename `ItemImplKind::Type` to `ItemImplKind::TyAlias`varkor-6/+6
2019-08-04Rename `ItemKind::Ty` to `ItemKind::TyAlias`varkor-7/+7
2019-08-04Auto merge of #62816 - estebank:type-ascription-macros, r=petrochenkovbors-9/+49
Point at type ascription before macro invocation on expansion parse error Fix https://github.com/rust-lang/rust/issues/47666. Follow up to https://github.com/rust-lang/rust/pull/62791. r? @petrochenkov
2019-08-03Move special treatment of `derive(Copy, PartialEq, Eq)` from expansion ↵Vadim Petrochenkov-56/+26
infrastructure to elsewhere
2019-08-03Rollup merge of #63146 - Mark-Simulacrum:clean-attr, r=petrochenkovMazdak Farrokhzad-456/+183
Cleanup syntax::attr Mostly removing needless arguments to constructors r? @petrochenkov
2019-08-03Rollup merge of #62954 - ia0:fix_typo_span, r=CentrilMazdak Farrokhzad-2/+2
Fix typo in Delimited::open_tt
2019-08-03Auto merge of #63180 - varkor:trait-alias-impl-trait, r=Centrilbors-54/+46
Change opaque type syntax from `existential type` to type alias `impl Trait` This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature. The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC. This makes partial progress towards implementing https://github.com/rust-lang/rust/issues/63063. r? @Centril
2019-08-03Rollup merge of #63212 - Centril:param-attrs-pretty, r=davidtwcoMazdak Farrokhzad-10/+9
Pretty print attributes in `print_arg` Fixes https://github.com/rust-lang/rust/issues/63210. cc https://github.com/rust-lang/rust/issues/60406 r? @petrochenkov
2019-08-02Auto merge of #63207 - petrochenkov:outest2, r=Mark-Simulacrumbors-1322/+1293
Unconfigure compiler unit test files during normal build I haven't touched libstd though, it had a lot of tests and I'm not sure the people maintaining it want this. Closes https://github.com/rust-lang/rust/issues/61097 r? @Mark-Simulacrum
2019-08-02Rollup merge of #63202 - exphp-forks:parser-ice-63135, r=estebankMazdak Farrokhzad-1/+9
Fix ICE in #63135 Closes #63135. r?@estebank
2019-08-02Rollup merge of #63198 - rbartlensky:fix-macro-trailing-comma, r=petrochenkovMazdak Farrokhzad-1/+4
Allow trailing comma in macro 2.0 declarations. This should hopefully close #63102.
2019-08-02Rollup merge of #63189 - waywardmonkeys:doc-improvements, r=CentrilMazdak Farrokhzad-1/+1
Doc improvements Miscellaneous documentation fixes.
2019-08-02Print outer attributes on formal params.Mazdak Farrokhzad-0/+3
2019-08-02Cleanup 'print_generic_params'.Mazdak Farrokhzad-10/+6
2019-08-02Replace "existential" by "opaque"varkor-31/+31
2019-08-02Switch existential_type to type_alias_impl_traitvarkor-23/+15
2019-08-02Remove some more `cfg(test)`sVadim Petrochenkov-20/+16
2019-08-02libsyntax: Unconfigure tests during normal buildVadim Petrochenkov-1302/+1277
2019-08-01Fix ICE in #63135Michael Lamparski-1/+9
2019-08-01Allow trailing comma in macro 2.0 declarations.Robert Bartlensky-1/+4
2019-08-02Fix typos in doc comments.Bruce Mitchener-1/+1
2019-08-01Rollup merge of #63170 - matklad:cleanup-fields, r=petrochenkovPietro Albini-12/+11
cleanup StringReader fields reduce visibility and replace `Lrc<SourceFile>` with `start_pos`: the single bit we actually *need* from the file. r? @petrochenkov
2019-08-01Rollup merge of #63122 - Centril:fix-63115, r=petrochenkovPietro Albini-6/+16
Account for `maybe_whole_expr` in range patterns Fixes https://github.com/rust-lang/rust/issues/63115 (fallout from https://github.com/rust-lang/rust/pull/62550). r? @petrochenkov
2019-07-31Address review comments.Mazdak Farrokhzad-8/+4