rust/src/test/run-pass-fulldeps
Alex Crichton d4d276faaf Rollup merge of #38842 - abonander:proc_macro_attribute, r=jseyfried
Implement `#[proc_macro_attribute]`

This implements `#[proc_macro_attribute]` as described in https://github.com/rust-lang/rfcs/pull/1566

The following major (hopefully non-breaking) changes are included:

* Refactor `proc_macro::TokenStream` to use `syntax::tokenstream::TokenStream`.
    * `proc_macro::tokenstream::TokenStream` no longer emits newlines between items, this can be trivially restored if desired
    * `proc_macro::TokenStream::from_str` does not try to parse an item anymore, moved to `impl MultiItemModifier for CustomDerive` with more informative error message

* Implement `#[proc_macro_attribute]`, which expects functions of the kind `fn(TokenStream, TokenStream) -> TokenStream`
    * Reactivated `#![feature(proc_macro)]` and gated `#[proc_macro_attribute]` under it
    * `#![feature(proc_macro)]` and `#![feature(custom_attribute)]` are mutually exclusive
    * adding `#![feature(proc_macro)]` makes the expansion pass assume that any attributes that are not built-in, or introduced by existing syntax extensions, are proc-macro attributes

* Fix `feature_gate::find_lang_feature_issue()` to not use `unwrap()`

    * This change wasn't necessary for this PR, but it helped debugging a problem where I was using the wrong feature string.

* Move "completed feature gate checking" pass to after "name resolution" pass

    * This was necessary for proper feature-gating of `#[proc_macro_attribute]` invocations when the `proc_macro` feature flag isn't set.

Prototype/Litmus Test: [Implementation](https://github.com/abonander/anterofit/blob/proc_macro/service-attr/src/lib.rs#L13) -- [Usage](https://github.com/abonander/anterofit/blob/proc_macro/service-attr/examples/post_service.rs#L35)
2017-01-20 08:34:30 -08:00
..
auxiliary proc macros/qquote: Handle empty delimited tokens 2017-01-16 13:54:36 +13:00
issue-37290 rustc: separate bodies for static/(associated)const and embedded constants. 2016-12-28 11:27:57 +02:00
proc-macro Rollup merge of #38842 - abonander:proc_macro_attribute, r=jseyfried 2017-01-20 08:34:30 -08:00
ast_stmt_expr_attr.rs Move CrateConfig from Crate to ParseSess. 2016-10-29 07:52:58 +00:00
compiler-calls.rs Move CrateConfig from Crate to ParseSess. 2016-10-29 07:52:58 +00:00
conditional-debug-macro-off.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
create-dir-all-bare.rs Ignore cross-compilation in some fulldeps tests. 2015-04-22 20:32:14 -07:00
custom-derive-partial-eq.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
deprecated-derive.rs Fix compiletest so it respects warnings for run-pass. 2016-08-22 16:51:37 -07:00
derive-totalsum-attr.rs Add test for custom deriving plugins which rely on field attributes 2015-05-01 15:49:05 +05:30
derive-totalsum.rs Make #[derive(Anything)] into sugar for #[derive_Anything] 2015-03-06 18:20:16 -08:00
deriving-encodable-decodable-box.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
deriving-encodable-decodable-cell-refcell.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
deriving-global.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
dropck_tarena_sound_drop.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
empty-struct-braces-derive.rs Partially stabilize RFC 1506 "Clarify relationships between ADTs" 2016-11-08 22:34:05 +03:00
extern-mod-syntax.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-2804.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-4016.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-4036.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-11881.rs rustc_metadata: replace RBML with a simple and type-safe scheme. 2016-09-20 20:08:05 +03:00
issue-13560.rs Unignore some tests in stage1 2015-05-13 19:58:49 -04:00
issue-14021.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-15149.rs Removed many pointless calls to *iter() and iter_mut() 2015-06-10 21:14:03 +01:00
issue-15778-pass.rs Add regression tests for #15778 2015-03-02 13:22:03 -08:00
issue-15924.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-16822.rs rollup merge of #23786: alexcrichton/less-quotes 2015-03-27 16:10:25 -07:00
issue-16992.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
issue-18502.rs Fix fallout of removing quotes in crate names 2015-03-27 11:43:40 -07:00
issue-18763-quote-token-tree.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
issue-24972.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue_16723_multiple_items_syntax_ext.rs Auto merge of #21774 - ejjeong:enable-test-for-android, r=alexcrichton 2015-02-17 19:35:12 +00:00
linkage-visibility.rs [emscripten] Ignore tests 2016-08-10 16:38:31 +02:00
lint-group-plugin.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
lint-plugin-cmdline-allow.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
lint-plugin-cmdline-load.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
lint-plugin.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
llvm-pass-plugin.rs Allow plugins to register LLVM passes 2015-04-08 14:01:59 -07:00
logging-enabled-debug.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
logging-enabled.rs [emscripten] Ignore tests 2016-08-10 16:38:31 +02:00
logging-right-crate.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
logging-separate-lines.rs [emscripten] Ignore tests 2016-08-10 16:38:31 +02:00
lto-syntax-extension.rs test: Fix lto-syntax-extension 2015-07-27 10:42:04 -07:00
macro-crate-does-hygiene-work.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
macro-crate-multi-decorator-literals.rs Implement RFC#1559: allow all literals in attributes. 2016-08-25 13:25:22 -07:00
macro-crate-multi-decorator.rs Get tests passing 2015-05-01 17:14:52 +12:00
macro-crate-outlive-expansion-phase.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
macro-crate.rs Test derive expansion ordering. 2016-10-10 22:15:57 +00:00
macro-quote-1.rs Fix fallout in rustdoc and tests. 2016-11-21 12:16:46 +00:00
macro-quote-cond.rs Proc_macro is alive 2016-08-16 13:17:36 -07:00
macro-quote-empty-delims.rs proc macros/qquote: Handle empty delimited tokens 2017-01-16 13:54:36 +13:00
macro-quote-noprelude.rs Proc_macro is alive 2016-08-16 13:17:36 -07:00
macro-quote-prelude.rs Proc_macro is alive 2016-08-16 13:17:36 -07:00
mbe_matching_test_macro.rs Add quasiquote for matchers and attributes 2015-03-04 16:13:37 +01:00
mir-pass.rs Disable old trans access via -Z orbit, #[rustc_no_mir] or --disable-orbit. 2016-08-24 13:23:37 +03:00
myriad-closures.rs Move the myriad-closures.rs test case to run-pass-full test suite. 2016-11-22 15:16:54 -05:00
plugin-args-1.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
plugin-args-2.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
plugin-args-3.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
plugin-lib-ok-in-plugin.rs Warn when linking a plugin into a non-plugin crate 2015-02-12 12:44:31 -08:00
plugin-plus-extern-crate.rs Warn when linking a plugin into a non-plugin crate 2015-02-12 12:44:31 -08:00
proc_macro.rs Adds a ProcMacro form of syntax extension 2016-09-22 08:47:57 +12:00
qquote.rs Fix fallout in rustdoc and tests. 2016-11-21 12:16:46 +00:00
quote-tokens.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
quote-unused-sp-no-warning.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
regions-mock-tcx.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
rename-directory.rs std: Stabilize library APIs for 1.5 2015-10-25 09:36:32 -07:00
roman-numerals-macro.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
rust-log-filter.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
rustc_encodable_hygiene.rs prevent other encode methods from breaking derive(RustcEncodable) 2016-04-12 15:41:46 +02:00
syntax-extension-with-dll-deps.rs Require feature attributes, and add them where necessary 2015-03-23 14:40:26 -07:00