about summary refs log tree commit diff
path: root/src/test/compile-fail-fulldeps
AgeCommit message (Collapse)AuthorLines
2019-03-21cleanup: Remove compile-fail-fulldeps directory againVadim Petrochenkov-45/+0
2019-01-19Fix lints in testsJohn Kåre Alsaker-0/+4
2019-01-13Removed more copyright notices.Alexander Regueiro-10/+0
2018-12-26Store `Ident` rather than just `Name` in HIR types `Item` and `ForeignItem`.Alexander Regueiro-0/+51
2018-12-09Move compile-fail-fulldeps tests to ui-fulldepsVadim Petrochenkov-1238/+0
2018-11-30tests: move all proc_macro tests from -fulldeps.Eduard-Mihai Burtescu-1511/+0
2018-11-30tests: remove ignore-stage1 where possible in proc_macro tests.Eduard-Mihai Burtescu-13/+0
2018-11-27remove uses of feature gateMark Mansi-3/+0
2018-10-19Update TypedArena testsOliver Scherer-2/+2
2018-10-02Merge the `proc_macro_` expansion feature gates into a single ↵jeb-8/+4
`proc_macro_hygiene` gate.
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-3/+0
2018-09-25resolve: Do not block derive helper resolutions on single import resolutionsVadim Petrochenkov-4/+2
Derive helpers conflict currently conflict with anything else, so if some resolution from a single import appears later, it will result in error anyway
2018-09-17Auto merge of #54277 - petrochenkov:afterder, r=alexcrichtonbors-1/+1
Temporarily prohibit proc macro attributes placed after derives ... and also proc macro attributes used together with `#[test]`/`#[bench]`. Addresses item 6 from https://github.com/rust-lang/rust/pull/50911#issuecomment-411605393. The end goal is straightforward predictable left-to-right expansion order for attributes. Right now derives are expanded last regardless of their relative ordering with macro attributes and right now it's simpler to temporarily prohibit macro attributes placed after derives than changing the expansion order. I'm not sure whether the new beta is already released or not, but if it's released, then this patch needs to be backported, so the solution needs to be minimal. How to fix broken code (derives): - Move macro attributes above derives. This won't change expansion order, they are expanded before derives anyway. Using attribute macros on same items with `#[test]` and `#[bench]` is prohibited for similar expansion order reasons, but this one is going to be reverted much sooner than restrictions on derives. How to fix broken code (test/bench): - Enable `#![feature(plugin)]` (don't ask why). r? @ghost
2018-09-16resolve: Do not error on access to proc macros imported with `#[macro_use]`Vadim Petrochenkov-88/+0
2018-09-16Temporarily prohibit proc macro attributes placed after derivesVadim Petrochenkov-1/+1
... and also proc macro attributes used together with test/bench.
2018-09-10Feature gate non-builtin attributes in inner attribute positionVadim Petrochenkov-1/+6
2018-08-31Update testsflip1995-1/+1
2018-08-23Stabilize a few secondary macro featuresVadim Petrochenkov-23/+1
`tool_attributes`, `proc_macro_path_invoc`, partially `proc_macro_gen`
2018-08-21Auto merge of #53471 - petrochenkov:biattr2, r=oli-obkbors-1/+1
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-2/+2
Fix typos found by codespell.
2018-08-21Rollup merge of #53370 - jkozlowski:stabilize-macro_vis_matcher, r=cramertjkennytm-3/+3
Stabilize macro_vis_matcher This PR should stabilize [macro_vis_matcher](https://github.com/rust-lang/rust/issues/41022) feature. - [ ] "reference" book changes: https://github.com/rust-lang-nursery/reference/pull/400 - [ ] "Rust by example" book changes: https://github.com/rust-lang/rust-by-example/pull/1096 - [ ] "clippy" changes: https://github.com/rust-lang-nursery/rust-clippy/pull/3055 r? @cramertj
2018-08-20resolve: Consolidate error reporting for resolved macros in `fn ↵Vadim Petrochenkov-1/+1
resolve_macro_to_def`
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-19Stabilize macro_vis_matcherJakub Kozlowski-3/+3
2018-08-19Fix typos found by codespell.Matthias Krüger-2/+2
2018-08-17Fix undesirable falloutVadim Petrochenkov-3/+3
compile-fail-fulldeps/proc-macro/proc-macro-attributes.rs - resolution change for derive helper attributes with the same name as derive itself run-pass/macro-comma-support.rs - indeterminate resolutions for macros in expression positions ui/issues/issue-49074.rs - diagnostics regression, not enough recovery to report the second error ui/object-lifetime/object-lifetime-default.stderr - unstable diagnostics?
2018-08-17Stabilize `use_extern_macros`Vadim Petrochenkov-10/+2
2018-08-15syntax: Enforce attribute grammar in the parserVadim Petrochenkov-11/+2
2018-08-12Prohibit using macro-expanded `macro_export` macros through module-relative ↵Vadim Petrochenkov-1/+1
paths
2018-08-06Address review commentsVadim Petrochenkov-29/+4
Adjust a few fulldeps and pretty-printing tests Fix rebase
2018-08-06Enable macro modularization implicitly if one of "advanced" macro features ↵Vadim Petrochenkov-8/+6
is enabled Do not mark all builtin attributes as used when macro modularization is enabled
2018-08-05Fix run-pass-fulldeps testsvarkor-14/+14
2018-07-16rustc: Stabilize much of the `proc_macro` featureAlex Crichton-50/+22
This commit stabilizes some of the `proc_macro` language feature as well as a number of APIs in the `proc_macro` crate as [previously discussed][1]. This means that on stable Rust you can now define custom procedural macros which operate as attributes attached to items or `macro_rules!`-like bang-style invocations. This extends the suite of currently stable procedural macros, custom derives, with custom attributes and custom bang macros. Note though that despite the stabilization in this commit procedural macros are still not usable on stable Rust. To stabilize that we'll need to stabilize at least part of the `use_extern_macros` feature. Currently you can define a procedural macro attribute but you can't import it to call it! A summary of the changes made in this PR (as well as the various consequences) is: * The `proc_macro` language and library features are now stable. * Other APIs not stabilized in the `proc_macro` crate are now named under a different feature, such as `proc_macro_diagnostic` or `proc_macro_span`. * A few checks in resolution for `proc_macro` being enabled have switched over to `use_extern_macros` being enabled. This means that code using `#![feature(proc_macro)]` today will likely need to move to `#![feature(use_extern_macros)]`. It's intended that this PR, once landed, will be followed up with an attempt to stabilize a small slice of `use_extern_macros` just for procedural macros to make this feature 100% usable on stable. [1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252
2018-07-14Functions introducing procedural macros reserve a slot in the macro ↵Vadim Petrochenkov-1/+1
namespace as well
2018-06-30proc-macro: Use transparent marks for call-site hygieneVadim Petrochenkov-1/+1
2018-06-26lower case some feature gate messagesmark-3/+3
2018-05-27Make anon params lint warn-by-defaultMark Mansi-0/+3
2018-05-18rustc: Disallow modules and macros in expansionsAlex Crichton-0/+96
This commit feature gates generating modules and macro definitions in procedural macro expansions. Custom derive is exempt from this check as it would be a large retroactive breaking change (#50587). It's hoped that we can hopefully stem the bleeding to figure out a better solution here before opening up the floodgates. The restriction here is specifically targeted at surprising hygiene results [1] that result in non-"copy/paste" behavior. Hygiene and procedural macros is intended to be avoided as much as possible for Macros 1.2 by saying everything is "as if you copy/pasted the code", but modules and macros are sort of weird exceptions to this rule that aren't fully fleshed out. [1]: https://github.com/rust-lang/rust/issues/50504#issuecomment-387734625 cc #50504
2018-05-16Fix stability annotations for already stable bits of proc macro API 1.1Vadim Petrochenkov-6/+3
Remove unnecessary proc-macro-related `feature`s
2018-05-15TokenTree: Op -> Punct, Term -> IdentVadim Petrochenkov-11/+11
2018-05-14typeck: Save the index of private fieldsDan Robertson-0/+59
Save the index of all fields regardless of their visibility. Problems could occur later when attempting to index fields in error recovery if they are not inserted.
2018-05-10Auto merge of #49823 - Zoxc:term-str, r=alexcrichtonbors-3/+3
Remove usages of Term::as_str and mark it for removal Returning references to rustc internal data structures is a bad idea since their lifetimes are unrelated to the lifetimes of proc_macro values. See https://github.com/rust-lang/rust/pull/46972 and the `Taming thread-local storage` section of https://internals.rust-lang.org/t/parallelizing-rustc-using-rayon/6606 r? @alexcrichton
2018-05-02fix testsflip1995-1/+1
2018-05-01Remove `macro_reexport`Vadim Petrochenkov-21/+0
It's subsumed by `feature(use_extern_macros)` and `pub use`
2018-04-30Remove usages of Term::as_str and mark it for removalJohn Kåre Alsaker-3/+3
2018-04-30Add a few more tests for proc macro feature gatingVadim Petrochenkov-13/+42
2018-04-21Auto merge of #50120 - alexcrichton:more-proc-macro-gates, r=petrochenkovbors-5/+123
rustc: Tweak custom attribute capabilities This commit starts to lay some groundwork for the stabilization of custom attribute invocations and general procedural macros. It applies a number of changes discussed on [internals] as well as a [recent issue][issue], namely: * The path used to specify a custom attribute must be of length one and cannot be a global path. This'll help future-proof us against any ambiguities and give us more time to settle the precise syntax. In the meantime though a bare identifier can be used and imported to invoke a custom attribute macro. A new feature gate, `proc_macro_path_invoc`, was added to gate multi-segment paths and absolute paths. * The set of items which can be annotated by a custom procedural attribute has been restricted. Statements, expressions, and modules are disallowed behind two new feature gates: `proc_macro_expr` and `proc_macro_mod`. * The input to procedural macro attributes has been restricted and adjusted. Today an invocation like `#[foo(bar)]` will receive `(bar)` as the input token stream, but after this PR it will only receive `bar` (the delimiters were removed). Invocations like `#[foo]` are still allowed and will be invoked in the same way as `#[foo()]`. This is a **breaking change** for all nightly users as the syntax coming in to procedural macros will be tweaked slightly. * Procedural macros (`foo!()` style) can only be expanded to item-like items by default. A separate feature gate, `proc_macro_non_items`, is required to expand to items like expressions, statements, etc. Closes #50038 [internals]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252 [issue]: https://github.com/rust-lang/rust/issues/50038
2018-04-20rustc: Tweak custom attribute capabilitiesAlex Crichton-5/+123
This commit starts to lay some groundwork for the stabilization of custom attribute invocations and general procedural macros. It applies a number of changes discussed on [internals] as well as a [recent issue][issue], namely: * The path used to specify a custom attribute must be of length one and cannot be a global path. This'll help future-proof us against any ambiguities and give us more time to settle the precise syntax. In the meantime though a bare identifier can be used and imported to invoke a custom attribute macro. A new feature gate, `proc_macro_path_invoc`, was added to gate multi-segment paths and absolute paths. * The set of items which can be annotated by a custom procedural attribute has been restricted. Statements, expressions, and modules are disallowed behind two new feature gates: `proc_macro_expr` and `proc_macro_mod`. * The input to procedural macro attributes has been restricted and adjusted. Today an invocation like `#[foo(bar)]` will receive `(bar)` as the input token stream, but after this PR it will only receive `bar` (the delimiters were removed). Invocations like `#[foo]` are still allowed and will be invoked in the same way as `#[foo()]`. This is a **breaking change** for all nightly users as the syntax coming in to procedural macros will be tweaked slightly. * Procedural macros (`foo!()` style) can only be expanded to item-like items by default. A separate feature gate, `proc_macro_non_items`, is required to expand to items like expressions, statements, etc. Closes #50038 [internals]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252 [issue]: https://github.com/rust-lang/rust/issues/50038
2018-04-18proc_macro: Stay on the "use the cache" path moreAlex Crichton-0/+2
Discovered in #50061 we're falling off the "happy path" of using a stringified token stream more often than we should. This was due to the fact that a user-written token like `0xf` is equality-different from the stringified token of `15` (despite being semantically equivalent). This patch updates the call to `eq_unspanned` with an even more awful solution, `probably_equal_for_proc_macro`, which ignores the value of each token and basically only compares the structure of the token stream, assuming that the AST doesn't change just one token at a time. While this is a step towards fixing #50061 there is still one regression from #49154 which needs to be fixed.
2018-04-06Use `Ident` instead of `Name` in `MetaItem`Vadim Petrochenkov-1/+1