about summary refs log tree commit diff
path: root/src/libsyntax_expand/expand.rs
AgeCommit message (Collapse)AuthorLines
2019-12-30Rename directories for some crates from `syntax_x` to `rustc_x`Vadim Petrochenkov-1725/+0
`syntax_expand` -> `rustc_expand` `syntax_pos` -> `rustc_span` `syntax_ext` -> `rustc_builtin_macros`
2019-12-30Rollup merge of #64273 - petrochenkov:stabattrmod, r=CentrilYuki Okushi-7/+4
Stabilize attribute macros on inline modules While still gating non-inline modules in proc macro input. Split from https://github.com/rust-lang/rust/pull/63931 cc https://github.com/rust-lang/rust/issues/54727
2019-12-28Stabilize attribute macros on inline modulesVadim Petrochenkov-7/+4
2019-12-23extract parse_not_exprMazdak Farrokhzad-4/+2
2019-12-22Format the worldMark Rousskov-279/+408
2019-12-20Rollup merge of #67131 - Centril:item-merge, r=petrochenkovMazdak Farrokhzad-10/+10
Merge `TraitItem` & `ImplItem into `AssocItem` In this PR we: - Merge `{Trait,Impl}Item{Kind?}` into `AssocItem{Kind?}` as discussed in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286. - This is done by using the cover grammar of both forms. - In particular, it requires that we syntactically allow (under `#[cfg(FALSE)]`): - `default`ness on `trait` items, - `impl` items without a body / definition (`const`, `type`, and `fn`), - and associated `type`s in `impl`s with bounds, e.g., `type Foo: Ord;`. - The syntactic restrictions are replaced by semantic ones in `ast_validation`. - Move syntactic restrictions around C-variadic parameters from the parser into `ast_validation`: - `fn`s in all contexts now syntactically allow `...`, - `...` can occur anywhere in the list syntactically (`fn foo(..., x: usize) {}`), - and `...` can be the sole parameter (`fn foo(...) {}`. r? @petrochenkov
2019-12-18Propagate cfg bootstrapMark Rousskov-1/+0
2019-12-12Remove `ast::{Impl,Trait}{Item,ItemKind}`.Mazdak Farrokhzad-2/+2
2019-12-12Unify associated item mut visitors.Mazdak Farrokhzad-8/+8
2019-12-02syntax: Use `ast::MacArgs` for attributesVadim Petrochenkov-21/+7
2019-12-02syntax: Remove redundant span from `ast::Mac`Vadim Petrochenkov-2/+2
Also remove a couple of redundant `visit_mac` asserts
2019-11-30move GateIssue to rustc_feature & simplify emit_feature_errMazdak Farrokhzad-13/+15
2019-11-30move is_builtin_attr to syntax::attrMazdak Farrokhzad-2/+2
2019-11-30introduce crate rustc_feature and move active, accepted, and removed to itMazdak Farrokhzad-2/+3
2019-11-24expand: Fully preserve visibilities on unnamed fields with attributesVadim Petrochenkov-2/+20
2019-11-19Move syntax_expand::config to rustc_parse::configMark Rousskov-1/+1
2019-11-16expand: Stop marking derive helper attributes as knownVadim Petrochenkov-16/+4
Pass them through name resolution instead
2019-11-10move syntax::parse -> librustc_parseMazdak Farrokhzad-3/+3
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-10move config.rs to libsyntax_expandMazdak Farrokhzad-2/+2
2019-11-09move attr meta grammar to parse::validate_atr + ast_validationMazdak Farrokhzad-1/+3
2019-11-08Rollup merge of #65785 - Centril:compat-to-error-2, r=oli-obkMazdak Farrokhzad-1/+1
Transition future compat lints to {ERROR, DENY} - Take 2 Follow up to https://github.com/rust-lang/rust/pull/63247 implementing https://github.com/rust-lang/rust/pull/63247#issuecomment-536295992. - `legacy_ctor_visibility` (ERROR) -- closes #39207 - `legacy_directory_ownership` (ERROR) -- closes #37872 - `safe_extern_static` (ERROR) -- closes #36247 - `parenthesized_params_in_types_and_modules` (ERROR) -- closes #42238 - `duplicate_macro_exports` (ERROR) - `nested_impl_trait` (ERROR) -- closes #59014 - `ill_formed_attribute_input` (DENY) -- transitions #57571 - `patterns_in_fns_without_body` (DENY) -- transitions #35203 r? @varkor cc @petrochenkov
2019-11-07move PResult to librustc_errorsMazdak Farrokhzad-2/+2
2019-11-07syntax::parser::token -> syntax::tokenMazdak Farrokhzad-1/+1
2019-11-06Make doc comments cheaper with `AttrKind`.Nicholas Nethercote-8/+10
`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a big performance win (over 10% in some cases) because `DocComment` lets doc comments (which are common) be represented very cheaply. `Attribute` gets some new helper methods to ease the transition: - `has_name()`: check if the attribute name matches a single `Symbol`; for `DocComment` variants it succeeds if the symbol is `sym::doc`. - `is_doc_comment()`: check if it has a `DocComment` kind. - `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant; panic otherwise. Fixes #60935.
2019-11-06Remove unnecessary `Deref` impl for `Attribute`.Nicholas Nethercote-4/+4
This kind of thing just makes the code harder to read.
2019-11-06legacy_directory_ownership -> errorMazdak Farrokhzad-1/+1
2019-11-05Review feedback: Remove more stuff! Simplify simplify simplify!Felix S. Klock II-1/+1
2019-11-04expand: Feature gate out-of-line modules in proc macro inputVadim Petrochenkov-16/+50
2019-10-19Avoid ICE when include! is used by stdin crateNika Layzell-1/+8
This should also eliminate the ICE when using `include_bytes!`, `include_str!` and `#[doc(include = "...")]`. Fixes #63900
2019-10-19expand: Simplify expansion of derivesVadim Petrochenkov-11/+22
And make it more uniform with other macros. By merging placeholders for future derives' outputs into the derive container's output fragment early.
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-0/+1551