about summary refs log tree commit diff
path: root/src/libsyntax/ext/expand.rs
AgeCommit message (Collapse)AuthorLines
2018-11-03Added support for trait aliases as object types.Alexander Regueiro-1/+1
2018-11-01Rollup merge of #55542 - ljedrz:syntax_alloc_improvements, r=kennytmPietro Albini-0/+2
syntax: improve a few allocations Add 2 `reserve`s and a `with_capacity` where the final vector size is known.
2018-10-31syntax: improve a few allocationsljedrz-0/+2
2018-10-31use String::from() instead of format!() macro to construct Strings.Matthias Krüger-1/+1
2018-10-28Provide specific label for patern parsing errorEsteban Küber-1/+1
2018-10-26Rollup merge of #55298 - estebank:macro-def, r=pnkfelixkennytm-2/+7
Point at macro definition when no rules expect token Fix #35150.
2018-10-24Fix incorrect semicolon suggestionEsteban Küber-1/+3
2018-10-23Point at macro definition when no rules expect tokenEsteban Küber-2/+7
2018-10-23Modify invalid macro in expression context diagnosticEsteban Küber-4/+20
2018-10-05Rollup merge of #54833 - abonander:issue-54441, r=petrochenkovPietro Albini-3/+1
make `Parser::parse_foreign_item()` return a foreign item or error Fixes `Parser::parse_foreign_item()` to follow the convention of `parse_trait_item()` and `parse_impl_item()` in that it *must* parse an item or return an error, and then the caller is responsible for detecting the closing delimiter. This prevents it from looping endlessly on an unexpected token in `ext/expand.rs` where it was also leaking memory by continually pushing to `Parser::expected_tokens` via `Parser::check_keyword()`. closes #54441 r? @petrochenkov cc @dtolnay
2018-10-05Auto merge of #54336 - petrochenkov:preuni, r=alexcrichtonbors-43/+30
resolve: Some refactorings in preparation for uniform paths 2.0 The main result is that in-scope resolution performed during macro expansion / import resolution is now consolidated in a single function (`fn early_resolve_ident_in_lexical_scope`), which can now be used for resolving first import segments as well when uniform paths are enabled. r? @ghost
2018-10-05make `Parser::parse_foreign_item()` return a foreign item or errorAustin Bonander-3/+1
closes #54441
2018-10-05expansion: Remove restriction on use of macro attributes with test/benchVadim Petrochenkov-43/+30
The restrictions were introduced in https://github.com/rust-lang/rust/pull/54277 and no longer necessary now because legacy plugins are now expanded in usual left-to-right order
2018-10-02Merge the `proc_macro_` expansion feature gates into a single ↵jeb-13/+10
`proc_macro_hygiene` gate.
2018-09-27Auto merge of #52319 - tinco:issue_12590, r=pnkfelixbors-0/+1
Track whether module declarations are inline (fixes #12590) To track whether module declarations are inline I added a field `inline: bool` to `ast::Mod`. The main use case is for pretty to know whether it should render the items associated with the module, but perhaps there are use cases for this information to not be forgotten in the AST.
2018-09-26Remove OneVectorljedrz-18/+23
2018-09-16Temporarily prohibit proc macro attributes placed after derivesVadim Petrochenkov-39/+59
... and also proc macro attributes used together with test/bench.
2018-09-13resolve: Put different parent scopes into a single structureVadim Petrochenkov-1/+1
2018-09-10Track whether module declarations are inline (fixes #12590)Tinco Andringa-0/+1
2018-09-10Feature gate non-builtin attributes in inner attribute positionVadim Petrochenkov-8/+23
2018-09-04Move #[test_case] to a syntax extensionJohn Renner-45/+5
2018-09-04Introduce Custom Test FrameworksJohn Renner-38/+10
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-2/+2
2018-08-23Auto merge of #53384 - gootorov:use-servo-smallvec, r=michaelwoeristerbors-4/+5
Use optimized SmallVec implementation This PR replaces current SmallVec implementation with the one from the Servo project. Closes https://github.com/rust-lang/rust/issues/51640 r? @Mark-Simulacrum
2018-08-23Use optimized SmallVec implementationIgor Gutorov-4/+5
2018-08-23Stabilize a few secondary macro featuresVadim Petrochenkov-10/+5
`tool_attributes`, `proc_macro_path_invoc`, partially `proc_macro_gen`
2018-08-21Auto merge of #53471 - petrochenkov:biattr2, r=oli-obkbors-12/+3
resolve: Some macro resolution refactoring Work towards completing https://github.com/rust-lang/rust/pull/50911#issuecomment-411605393 The last commit also fixes https://github.com/rust-lang/rust/issues/53269 by not using `def_id()` on `Def::Err` and also fixes https://github.com/rust-lang/rust/issues/53512.
2018-08-21Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkorkennytm-1/+1
Fix typos found by codespell.
2018-08-20resolve: Consolidate error reporting for resolved macros in `fn ↵Vadim Petrochenkov-12/+3
resolve_macro_to_def`
2018-08-19mv codemap() source_map()Donato Sciarra-3/+3
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-19mv filemap source_fileDonato Sciarra-1/+1
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-08-18Use the new Entry::or_default method where possible.Eduard-Mihai Burtescu-2/+2
2018-08-17Stabilize `use_extern_macros`Vadim Petrochenkov-10/+2
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-22/+22
2018-08-06Address review commentsVadim Petrochenkov-22/+12
Adjust a few fulldeps and pretty-printing tests Fix rebase
2018-08-06Support custom attributes when macro modularization is enabledVadim Petrochenkov-9/+13
2018-08-06Avoid modifying invocations in place for derive helper attributesVadim Petrochenkov-19/+2
2018-08-02Auto merge of #52841 - petrochenkov:premacro, r=alexcrichtonbors-3/+21
resolve: Implement prelude search for macro paths, implement tool attributes When identifier is macro path is resolved in scopes (i.e. the first path segment - `foo` in `foo::mac!()` or `foo!()`), scopes are searched in the same order as for non-macro paths - items in modules, extern prelude, tool prelude (see later), standard library prelude, language prelude, but with some extra shadowing restrictions (names from globs and macro expansions cannot shadow names from outer scopes). See the comment in `fn resolve_lexical_macro_path_segment` for more details. "Tool prelude" currently contains two "tool modules" `rustfmt` and `clippy`, and is searched immediately after extern prelude. This makes the [possible long-term solution](https://github.com/rust-lang/rfcs/blob/master/text/2103-tool-attributes.md#long-term-solution) for tool attributes exactly equivalent to the existing extern prelude scheme, except that `--extern=my_crate` making crate names available in scope is replaced with something like `--tool=my_tool` making tool names available in scope. The `tool_attributes` feature is still unstable and `#![feature(tool_attributes)]` now implicitly enables `#![feature(use_extern_macros)]`. `use_extern_macros` is a prerequisite for `tool_attributes`, so their stabilization will happen in the same order. If `use_extern_macros` is not enabled, then tool attributes are treated as custom attributes (this is temporary, anyway). Fixes https://github.com/rust-lang/rust/issues/52576 Fixes https://github.com/rust-lang/rust/issues/52512 Fixes https://github.com/rust-lang/rust/issues/51277 cc https://github.com/rust-lang/rust/issues/52269
2018-08-02Auto merge of #52890 - djrenren:test-visibility, r=petrochenkovbors-5/+62
Reexport tests without polluting namespaces This should fix issue #52557. Basically now we gensym a new name for the test function and reexport that. That way the test function's reexport name can't conflict because it was impossible for the test author to write it down. We then use a `use` statement to expose the original name using the original visibility.
2018-08-01Use the correct allowJohn Renner-3/+3
2018-08-01Allow test imports to go unusedJohn Renner-1/+15
2018-08-01resolve: Implement prelude search for macro pathsVadim Petrochenkov-3/+21
resolve/expansion: Implement tool attributes
2018-07-31Address code reviewJohn Renner-5/+10
2018-07-31Allow unnameable testsJohn Renner-8/+28
2018-07-30Reexport tests without polluting namespacesJohn Renner-1/+19
2018-07-27Prefer to_string() to format!()ljedrz-2/+2
2018-07-23Implement 2015 vs 2018 `?` kleene op + testmark-8/+10
2018-07-22Auto merge of #52394 - estebank:println, r=oli-obkbors-0/+1
Improve suggestion for missing fmt str in println Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal. Fix #52347.