summary refs log tree commit diff
path: root/src/test/ui/proc-macro
AgeCommit message (Collapse)AuthorLines
2019-09-13pprust: Do not print spaces before some tokensVadim Petrochenkov-4/+4
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
2019-04-15normalize away some Windows-only panic printingRalf Jung-3/+15
2019-04-11Reword tracking issue noteEsteban Küber-33/+33
2019-04-10Tweak unstable diagnostic outputEsteban Küber-33/+66
2019-04-05Include trailing comma in multiline Debug representationDavid Tolnay-80/+80
This commit changes the behavior of Formatter::debug_struct, debug_tuple, debug_list, debug_set, and debug_map to render trailing commas in {:#?} mode, which is the dominant style in modern Rust code. Before: Language { name: "Rust", trailing_commas: false } After: Language { name: "Rust", trailing_commas: true, }
2019-03-25Auto merge of #59258 - euclio:suggestions-filter-crate, r=oli-obkbors-1/+1
filter suggestions from extern prelude Fixes #59027. Modifies the candidate gathering code to call `filter_fn` on extern crates, which causes them to be filtered out when looking for a type.
2019-03-23Mark duplicate import removal suggestion tool onlyEsteban Küber-1/+0
2019-03-23Tweak unnecessary import suggestionEsteban Küber-8/+6
2019-03-18filter suggestions from extern preludeAndy Russell-1/+1
2019-03-16syntax: Introduce `Ident::can_be_raw`Vadim Petrochenkov-1/+1