summary refs log tree commit diff
path: root/src/test/ui/proc-macro
AgeCommit message (Collapse)AuthorLines
2020-03-01Make `rustc_attrs` tracking issue NoneYuki Okushi-1/+0
2020-02-24syntax: Remove `Nt(Impl,Trait,Foreign)Item`Vadim Petrochenkov-0/+14
2020-02-17Add a test for proc macro generating `$ IDENT`Vadim Petrochenkov-0/+35
2020-02-09--bless --compare-mode=nllMatthias Prechtl-20/+20
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-1/+69
2020-02-06rustc_errors: hide "in this macro invocation" when redundant, more explicitly.Eduard-Mihai Burtescu-32/+14
2020-02-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-1/+1
2020-02-05review commentsEsteban Küber-2/+2
2020-02-05Suggest `'r` instead of `'lifetime`Esteban Küber-2/+2
2020-02-02Change expansion error to be non-fatalDavid-2/+12
Changes the error handler for inner attributes that replace the root with a non-module. Previously it would emit a fatal error. It now emits an empty expasion and a non-fatal error like the existing handler for a failed expansion.
2020-02-01Add tests for issue 59191David Ross-0/+31
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-2/+2
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2020-01-26Suggest defining type parameter when appropriateEsteban Küber-0/+12
``` error[E0412]: cannot find type `T` in this scope --> file.rs:3:12 | 3 | impl Trait<T> for Struct {} | - ^ not found in this scope | | | help: you might be missing a type parameter: `<T>` ``` Fix #64298.
2020-01-24Normalise notes with the/isvarkor-2/+2
2020-01-19review commentsEsteban Küber-1/+1
2020-01-19When encountering an expected named lifetime and none are present, suggest ↵Esteban Küber-1/+7
adding one
2020-01-16resolve: Say "import" when reporting private importsVadim Petrochenkov-4/+4
2020-01-16resolve: Point at the private item definitions in privacy errorsVadim Petrochenkov-1/+7
2020-01-10Ignore platforms that can't point to stdEsteban Küber-36/+59
2020-01-10Use `def_span` to minimize definition span to first line when possibleEsteban Küber-25/+17
2020-01-10Point at the span for the definition of crate foreign ADTsEsteban Küber-8/+56
2020-01-09Update testsVadim Petrochenkov-18/+60
2020-01-03tweak wording of mismatched delimiter errorsAndy Russell-3/+3
2019-12-28Stabilize attribute macros on inline modulesVadim Petrochenkov-65/+54
2019-12-03Emit coercion suggestions in more placesAaron Hill-0/+5
Fixes #66910 We have several different kinds of suggestions we can try to make when type coercion fails. However, we were previously only emitting these suggestions from `demand_coerce_diag`. This resulted in the compiler failing to emit applicable suggestions in several different cases, such as when the implicit return value of a function had the wrong type. This commit adds a new `emit_coerce_suggestions` method, which tries to emit a number of related suggestions. This method is called from both `demand_coerce_diag` and `CoerceMany::coerce_inner`, which covers a much wider range of cases than before. We now suggest using `.await` in more cases where it is applicable, among other improvements.
2019-12-02syntax: Use `ast::MacArgs` for attributesVadim Petrochenkov-2/+2
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-9/+27
2019-11-21Auto merge of #66389 - estebank:type-err-labels, r=petrochenkovbors-60/+21
Specific labels when referring to "expected" and "found" types
2019-11-20Rollup merge of #66060 - traxys:test_65401, r=michaelwoeristerMazdak Farrokhzad-2/+2
Making ICEs and test them in incremental This adds: - A way to make the compiler ICE - A way to check for ICE in `cfail` tests with `should-ice` - A regression test for issue #65401 I am not sure the attribute added `should-ice` is the best for this job
2019-11-18fix rebaseEsteban Küber-12/+3
2019-11-19resolve: Give derive helpers highest priority during resolutionVadim Petrochenkov-39/+31
2019-11-18Surround types with backticks in type errorsEsteban Küber-14/+14
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-39/+9
2019-11-18review comments: tweak prefix stringsEsteban Küber-4/+4
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-21/+21
2019-11-17Rollup merge of #66271 - petrochenkov:abism, r=CentrilYuki Okushi-18/+52
syntax: Keep string literals in ABIs and `asm!` more precisely As a result we don't lose spans when `extern` functions or blocks are passed to proc macros, and also escape all string literals consistently. Continuation of https://github.com/rust-lang/rust/pull/60679, which did a similar thing with all literals besides those in ABIs and `asm!`. TODO: Add tests. Fixes https://github.com/rust-lang/rust/issues/60493 Fixes https://github.com/rust-lang/rust/issues/64561 r? @Centril
2019-11-17Add some more testsVadim Petrochenkov-1/+33
2019-11-16ast: Keep `extern` qualifiers in functions more preciselyVadim Petrochenkov-17/+19
2019-11-16Add some more testsVadim Petrochenkov-13/+78
2019-11-16expand: Stop marking derive helper attributes as knownVadim Petrochenkov-7/+41
Pass them through name resolution instead
2019-11-16resolve: Introduce a new scope for derive helpersVadim Petrochenkov-6/+24
2019-11-12Rollup merge of #66278 - LukasKalbertodt:fix-proc-macro-error, r=CentrilYuki Okushi-6/+6
Fix error message about exported symbols from proc-macro crates Someone forgot to update the error message after `#[proc_macro]` and `#[proc_macro_attribute]` were stabilized.
2019-11-11Fix error message about exported symbols from proc-macro cratesLukas Kalbertodt-6/+6
Someone forgot to update the error message after `#[proc_macro]` and `#[proc_macro_attribute]` were stabilized.
2019-11-10Auto merge of #66070 - petrochenkov:regattr, r=matthewjasperbors-7/+24
Support registering inert attributes and attribute tools using crate-level attributes And remove `#[feature(custom_attribute)]`. (`rustc_plugin::Registry::register_attribute` is not removed yet, I'll do it in a follow up PR.) ```rust #![register_attr(my_attr)] #![register_tool(my_tool)] #[my_attr] // OK #[my_tool::anything] // OK fn main() {} ``` --- Some tools (`rustfmt` and `clippy`) used in tool attributes are hardcoded in the compiler. We need some way to introduce them without hardcoding as well. This PR introduces a way to do it with a crate level attribute. The previous attempt to introduce them through command line (https://github.com/rust-lang/rust/pull/57921) met some resistance. This probably needs to go through an RFC before stabilization. However, I'd prefer to land *this* PR without an RFC to able to remove `#[feature(custom_attribute)]` and `Registry::register_attribute` while also providing a replacement. --- `register_attr` is a direct replacement for `#![feature(custom_attribute)]` (https://github.com/rust-lang/rust/issues/29642), except it doesn't rely on implicit fallback from unresolved attributes to custom attributes (which was always hacky and is the primary reason for the removal of `custom_attribute`) and requires registering the attribute explicitly. It's not clear whether it should go through stabilization or not. It's quite possible that all the uses should migrate to `#![register_tool]` (https://github.com/rust-lang/rust/issues/66079) instead. --- Details: - The naming is `register_attr`/`register_tool` rather than some `register_attributes` (plural, no abbreviation) for consistency with already existing attributes like `cfg_attr`, or `feature`, etc. --- Previous attempt: https://github.com/rust-lang/rust/pull/57921 cc https://github.com/rust-lang/rust/issues/44690 Tracking issues: #66079 (`register_tool`), #66080 (`register_attr`) Closes https://github.com/rust-lang/rust/issues/29642
2019-11-09Remove `#[feature(custom_attribute)]`Vadim Petrochenkov-7/+24
2019-11-09move attr meta grammar to parse::validate_atr + ast_validationMazdak Farrokhzad-12/+12
2019-11-07Rollup merge of #66087 - tmiasko:ui-mode, r=CentrilMazdak Farrokhzad-1/+1
Update some build-pass ui tests to use check-pass where applicable Helps with issue https://github.com/rust-lang/rust/issues/62277.
2019-11-05rewrote error messages for #[rustc_error]Quentin Boyer-2/+2
2019-11-04Use check-pass in ui tests where appropriateTomasz Miąsko-1/+1
2019-11-04expand: Feature gate out-of-line modules in proc macro inputVadim Petrochenkov-0/+132