about summary refs log tree commit diff
path: root/src/libsyntax_ext
AgeCommit message (Collapse)AuthorLines
2018-07-15Auto merge of #52383 - petrochenkov:pmns, r=alexcrichtonbors-5/+0
resolve: Functions introducing procedural macros reserve a slot in the macro namespace as well Similarly to https://github.com/rust-lang/rust/pull/52234, this gives us symmetry between internal and external views of a crate, but in this case it's always an error to call a procedural macro in the same crate in which it's defined. Closes https://github.com/rust-lang/rust/issues/52225
2018-07-14Auto merge of #52326 - alexcrichton:tweak-proc-macro-expand, r=petrochenkovbors-3/+8
rustc: Tweak expansion of #[proc_macro] for 2018 The syntactical expansion of `#[proc_macro]` and related attributes currently contains absolute paths which conflicts with a lint for the 2018 edition, causing issues like #52214. This commit puts a band-aid on the issue by ensuring that procedural macros can also migrate to the 2018 edition for now by tweaking the expansion based on what features are activated. A more long-term solution would probably tweak the edition hygiene of spans, but this should do the trick for now. Closes #52214
2018-07-14Functions introducing procedural macros reserve a slot in the macro ↵Vadim Petrochenkov-5/+0
namespace as well
2018-07-14Address commentsVadim Petrochenkov-6/+4
2018-07-14Remove some tests using AST comparisons, fix other testsVadim Petrochenkov-4/+4
2018-07-14Remove most of `PartialEq` impls from AST and HIR structuresVadim Petrochenkov-20/+16
2018-07-13rustc: Tweak expansion of #[proc_macro] for 2018Alex Crichton-3/+8
The syntactical expansion of `#[proc_macro]` and related attributes currently contains absolute paths which conflicts with a lint for the 2018 edition, causing issues like #52214. This commit puts a band-aid on the issue by ensuring that procedural macros can also migrate to the 2018 edition for now by tweaking the expansion based on what features are activated. A more long-term solution would probably tweak the edition hygiene of spans, but this should do the trick for now. Closes #52214
2018-07-13proc_macro: Fix crate root detectionVadim Petrochenkov-10/+6
2018-07-12Rollup merge of #52295 - ljedrz:dyn_libsyntax_ext, r=petrochenkovkennytm-35/+37
Deny bare trait objects in src/libsyntax_ext Enforce `#![deny(bare_trait_objects)]` in `src/libsyntax_ext`.
2018-07-12Rollup merge of #52276 - alexcrichton:validate-proc-macro-attr, r=petrochenkovkennytm-4/+4
rustc: Verify #[proc_macro] is only a word ... and perform the same verification for #[proc_macro_attribute], currently neither of these attributes take any arguments. Closes #52273
2018-07-12Deny bare trait objects in src/libsyntax_extljedrz-35/+37
2018-07-11rustc: Verify #[proc_macro] is only a wordAlex Crichton-4/+4
... and perform the same verification for #[proc_macro_attribute], currently neither of these attributes take any arguments. Closes #52273
2018-07-11suggest on new snippetcsmoe-29/+29
2018-07-06suggests with whole macro callcsmoe-10/+1
2018-07-04add span notecsmoe-1/+8
2018-07-03Suggestion for printcsmoe-1/+8
2018-06-27Implement `#[macro_export(local_inner_macros)]`Vadim Petrochenkov-0/+3
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-7/+7
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-23hygiene: Merge `NameAndSpan` into `ExpnInfo`Vadim Petrochenkov-10/+8
2018-06-21Parse async fn header.Without Boats-5/+5
This is gated on edition 2018 & the `async_await` feature gate. The parser will accept `async fn` and `async unsafe fn` as fn items. Along the same lines as `const fn`, only `async unsafe fn` is permitted, not `unsafe async fn`.The parser will not accept `async` functions as trait methods. To do a little code clean up, four fields of the function type struct have been merged into the new `FnHeader` struct: constness, asyncness, unsafety, and ABI. Also, a small bug in HIR printing is fixed: it previously printed `const unsafe fn` as `unsafe const fn`, which is grammatically incorrect.
2018-06-20Fix additional commentsvarkor-1/+1
2018-06-20Rename ty_param_bound to trait_boundvarkor-5/+5
2018-06-20Rename ParamBound(s) to GenericBound(s)varkor-2/+2
2018-06-20Remove name from GenericParamKind::Lifetimevarkor-4/+4
2018-06-20Lift bounds into GenericParamvarkor-12/+10
2018-06-20Simply joint lifetime/type iterationvarkor-58/+22
2018-06-20Rename structures in astvarkor-26/+26
2018-06-20Remove all traces of lifetimes() and types() methodsvarkor-23/+21
2018-06-20Remove methods from ast::GenericParam and ast::Genericsvarkor-2/+8
2018-06-20Refactor ast::GenericParam as a structvarkor-31/+29
2018-06-20Refactor hir::GenericParam as a structvarkor-3/+7
2018-06-20Rename ast::GenericParam and ast::GenericArgvarkor-27/+27
It's so confusing to have everything having the same name, at least while refactoring.
2018-06-20Rename "parameter" to "arg"varkor-15/+15
2018-06-20Rename *Parameter to *Paramvarkor-14/+14
2018-06-20Consolidate PathParameters and AngleBracketedParameterDatavarkor-21/+34
2018-06-18Add ability to apply custom derive to union types.Steve Pentland-3/+4
The Union item type has been included in the allowed types for a custom derive. Closes #50223
2018-05-26Add `Ident::as_str` helperVadim Petrochenkov-3/+3
2018-05-24Auto merge of #50971 - alexcrichton:no-stringify, r=petrochenkovbors-0/+1
rustc: Correctly pretty-print macro delimiters This commit updates the `Mac_` AST structure to keep track of the delimiters that it originally had for its invocation. This allows us to faithfully pretty-print macro invocations not using parentheses (e.g. `vec![...]`). This in turn helps procedural macros due to #43081. Closes #50840
2018-05-22rustc: Correctly pretty-print macro delimitersAlex Crichton-0/+1
This commit updates the `Mac_` AST structure to keep track of the delimiters that it originally had for its invocation. This allows us to faithfully pretty-print macro invocations not using parentheses (e.g. `vec![...]`). This in turn helps procedural macros due to #43081. Closes #50840
2018-05-23Rollup merge of #50846 - GuillaumeGomez:add-e0665, r=frewsxcvkennytm-6/+53
Add E0665
2018-05-21Remove rustc_serialize_exclude_nullManish Goregaokar-12/+2
2018-05-21Add E0665Guillaume Gomez-17/+53
2018-05-18Auto merge of #50307 - petrochenkov:keyhyg2, r=nikomatsakisbors-2/+6
Implement edition hygiene for keywords Determine "keywordness" of an identifier in its hygienic context. cc https://github.com/rust-lang/rust/pull/49611 I've resurrected `proc` as an Edition-2015-only keyword for testing purposes, but it should probably be buried again. EDIT: `proc` is removed again.
2018-05-17Pass crate editions to macro expansions, update testsVadim Petrochenkov-1/+4
2018-05-17Add edition to expansion infoVadim Petrochenkov-1/+2
2018-05-17Rollup merge of #50610 - estebank:fmt-str, r=KimundiMark Simulacrum-3/+6
Improve format string errors Point at format string position inside the formatting string: ``` error: invalid format string: unmatched `}` found --> $DIR/format-string-error.rs:21:22 | LL | let _ = format!("}"); | ^ unmatched `}` in format string ``` Explain that argument names can't start with an underscore: ``` error: invalid format string: invalid argument name `_foo` --> $DIR/format-string-error.rs:15:23 | LL | let _ = format!("{_foo}", _foo = 6usize); | ^^^^ invalid argument name in format string | = note: argument names cannot start with an underscore ``` Fix #23476. The more accurate spans will only be seen when using `format!` directly, when using `println!` the diagnostics machinery makes the span be the entire statement.
2018-05-17Auto merge of #50629 - Mark-Simulacrum:stage-step, r=alexcrichtonbors-18/+6
Switch to bootstrapping from 1.27 It's possible the Float trait could be removed from core, but I couldn't tell whether it was intended to be removed or not. @SimonSapin may be able to comment more here; we can presumably also do that in a follow up PR as this one is already quite large.
2018-05-17Switch to 1.26 bootstrap compilerMark Simulacrum-18/+6
2018-05-17Rename trans to codegen everywhere.Irina Popa-17/+17
2018-05-17Rollup merge of #50752 - GuillaumeGomez:more-error-code-in-libsyntax-ext, ↵kennytm-3/+58
r=frewsxcv Add missing error codes in libsyntax-ext asm