about summary refs log tree commit diff
path: root/src/test/ui/proc-macro
AgeCommit message (Collapse)AuthorLines
2019-08-27resolve: Block expansion of a derive container until all its derives are ↵Vadim Petrochenkov-46/+59
resolved Also mark derive helpers as known as a part of the derive container's expansion instead of expansion of the derives themselves which may happen too late.
2019-08-25pprust: Do not print spaces before some tokensVadim Petrochenkov-4/+4
2019-08-18Auto merge of #63269 - Aaron1011:feature/proc-macro-data, r=eddyb,petrochenkovbors-20/+32
Serialize additional data for procedural macros Split off from #62855 This PR serializes the declaration `Span` and attributes for all procedural macros. This allows Rustdoc to properly render doc comments and source links when performing inlinig procedural macros across crates
2019-08-17resolve: Properly integrate derives and `macro_rules` scopesVadim Petrochenkov-0/+25
2019-08-17Serialize additional data for procedural macrosAaron Hill-20/+32
Split off from #62855 This PR deerializes the declaration `Span` and attributes for all procedural macros from their underlying function definitions. This allows Rustdoc to properly render doc comments and source links when inlining procedural macros across crates
2019-08-16Rollup merge of #63535 - petrochenkov:expndata, r=matthewjasperMazdak Farrokhzad-12/+12
Continue refactoring resolve and hygiene The general goal is addressing FIXMEs from the previous PRs. Merging similar data structures (+ prerequisites for such merging), accounting for the fact that all `ExpnId`s have associated data in `HygieneData` now (less `Option`s). Also, some renaming. This should be the last renaming session in this area, I think. r? @matthewjasper
2019-08-15resolve: Move macro resolution traces from `Module`s to `Resolver`Vadim Petrochenkov-12/+12
Traces already contain module info without that. It's easy to forget to call `finalize_*` on a module. In particular, macros enum and trait modules weren't finalized. By happy accident macros weren't placed into those modules until now.
2019-08-15Move `test-macros.rs` back to `ui` to fix tests #62593Kevin Per-0/+112
2019-08-15Group all ui tests and move to abi #62593Kevin Per-166/+0
2019-08-12Update tests for excess semicolon lintNathan-2/+2
2019-08-09More explicit diagnostic when using a `vec![]` in a patternEsteban Küber-1/+1
``` 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-03Move special treatment of `derive(Copy, PartialEq, Eq)` from expansion ↵Vadim Petrochenkov-36/+36
infrastructure to elsewhere
2019-07-27tests: Move run-pass tests with naming conflicts to uiVadim Petrochenkov-0/+190
2019-07-27tests: Move run-pass tests without naming conflicts to uiVadim Petrochenkov-0/+1298
2019-07-26Introduce built-in macros through libcoreVadim Petrochenkov-17/+10
2019-07-23Normalize use of backticks in compiler messages for libsyntax/*Samy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-07-19Auto merge of #62684 - petrochenkov:scopevisit, r=davidtwcobors-81/+40
resolve: Improve candidate search for unresolved macro suggestions Use same scope visiting machinery for both collecting suggestion candidates and actually resolving the names. The PR is better read in per-commit fashion with whitespace changes ignored (the first commit in particular moves some code around). This should be the last pre-requisite for https://github.com/rust-lang/rust/pull/62086. r? @davidtwco
2019-07-18resolve: Visit all scopes to collect suggestion candidates for unresolved macrosVadim Petrochenkov-8/+8
2019-07-18resolve: Use `feature(custom_attribute)` fallback only if the feature is enabledVadim Petrochenkov-75/+34
Normally `#![feature(...)]` shouldn't change behavior, but custom attributes in particular are in the process of retirement, and we should not produce a message telling to enable them. It also helps with unifying diagnostics for unresolved macros.
2019-07-17normalize use of backticks in compiler messages for librustc/lintSamy Kacimi-2/+2
https://github.com/rust-lang/rust/issues/60532
2019-07-15Rollup merge of #62646 - estebank:wording, r=petrochenkovMark Rousskov-2/+2
Tweak wording in feature gate errors
2019-07-15pprust: Fix formatting regressions from the previous commitsVadim Petrochenkov-1/+1
Fix some remaining cases of bad formatting Update some failing tests
2019-07-15pprust: Use `print_mac_common` for delimited token groupsVadim Petrochenkov-11/+11
2019-07-13review commentsEsteban Küber-8/+8
2019-07-13Tweak wording in feature gate errorsEsteban Küber-10/+10
2019-07-11pretty-print: Do not lose the `$crate` printing flag in `print_tt`Vadim Petrochenkov-10/+10
2019-07-11Add a regression test for #44692Vadim Petrochenkov-1/+1
Add a test for the issue resolved by removing `resolve_macro_path` Add a test making sure that extern prelude entries introduced from an opaque macro are not visible anywhere, even it that macro Fix test output after rebase
2019-07-11resolve/expand: Catch macro kind mismatches early in resolveVadim Petrochenkov-16/+72
This way we are processing all of them in a single point, rather than separately for each syntax extension kind. Also, the standard expected/found wording is used.
2019-07-11resolve: Make proc macro stubs less stubbyVadim Petrochenkov-29/+47
Create real working and registered (even if dummy) `SyntaxExtension`s for them. This improves error recovery and allows to avoid all special cases for proc macro stubs (except for the error on use, of course). The introduced dummy `SyntaxExtension`s can be used for any other inappropriately resolved macros as well.
2019-07-10Rollup merge of #62393 - petrochenkov:notto-disu, r=Mark-SimulacrumMazdak Farrokhzad-8/+153
Fix pretty-printing of `$crate` (take 4) Pretty-print `$crate` as `crate` or `crate_name` in unstructured tokens like `a $crate c` in `foo!(a $crate c)`, but only if those tokens are printed as a part of AST pretty-printing, rather than as a standalone token stream. Fixes https://github.com/rust-lang/rust/issues/62325 Previous iterations - https://github.com/rust-lang/rust/pull/56647, https://github.com/rust-lang/rust/pull/57155, https://github.com/rust-lang/rust/pull/57915.
2019-07-09Add a test case with `$crate` from other crateVadim Petrochenkov-0/+66
2019-07-09Resolve `$crate` in all hygienic contexts for pretty-pringingVadim Petrochenkov-25/+15
Stop visiting AST to discover those contexts, just iterate through hygiene data instead
2019-07-09Pretty-print `$crate` as `crate`/`::my_crate` in tokensVadim Petrochenkov-8/+8
...but only if those tokens are printed from inside of AST pretty-printing.
2019-07-09Add a test for `$crate` inside macro invocationVadim Petrochenkov-0/+89
2019-07-09normalize use of backticks in compiler messages for libsyntax/feature_gateSamy Kacimi-39/+39
https://github.com/rust-lang/rust/issues/60532
2019-07-06resolve: Reserve cfg/cfg_attr/derive only in attribute sub-namespaceVadim Petrochenkov-6/+6
2019-07-05Rollup merge of #62133 - petrochenkov:norustc, r=eddybMazdak Farrokhzad-6/+15
Feature gate `rustc` attributes harder Fixes https://github.com/rust-lang/rust/issues/62116
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-11/+11
2019-06-30Feature gate `rustc` attributes harderVadim Petrochenkov-2/+13
2019-06-30Make sure `#[rustc_doc_only_macro]` and other rustc attributes are registeredVadim Petrochenkov-6/+4
2019-06-24Address review comments.Mazdak Farrokhzad-0/+1
2019-06-08Remove some more `#![feature(custom_attribute)]`sVadim Petrochenkov-6/+25
2019-05-29Rollup merge of #61024 - petrochenkov:proctest, r=nikomatsakisMazdak Farrokhzad-525/+475
tests: Centralize proc macros commonly used for testing Many proc macros in `ui\proc-macro\auxiliary` were doing same things. (I added a fair share of those myself.) Now commonly used macros (empty, identity, etc) are collected in one place - `ui\proc-macro\auxiliary\test-macros.rs`.
2019-05-25Reword malformed attribute input diagnosticsEsteban Küber-45/+43
- Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error - Use consistend error message: "malformed `attrname` attribute input" - Provide suggestions when possible - Move note/help to label/suggestion - Use consistent wording "ill-formed" -> "malformed" - Move diagnostic logic out of parser
2019-05-24Tweak macro parse errors when reaching EOF during macro call parseEsteban Küber-2/+2
- Add detail on origin of current parser when reaching EOF and stop saying "found <eof>" and point at the end of macro calls - Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error
2019-05-22tests: Centralize proc macros commonly used for testingVadim Petrochenkov-525/+475
2019-05-11Add #[doc(hidden)] attribute on compiler generated proc-macro module.Mike Boutin-0/+16
Stops unavoidable `missing_docs` warning/error on proc-macro crates. Resolves #42008.
2019-04-22Remove double trailing newlinesvarkor-2/+0
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-4/+4
2019-04-16this panic occurs not just on Windows, normalize it away everywhereRalf Jung-6/+6