rust/src
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
..
bootstrap Auto merge of #39052 - alexcrichton:fix-rebuild, r=brson 2017-01-15 11:03:48 +00:00
build_helper let BSD to use gmake for GNU-make 2016-12-17 20:09:23 +01:00
ci travis: Pass --release-channel=nightly on deploy 2017-01-16 22:26:21 -08:00
compiler-rt@a8fc4c169f Update compiler-rt to fix MIPS64 infinite recursion 2016-11-21 14:53:55 +08:00
doc An update to patterns documentation 2017-01-15 12:27:41 -08:00
driver
etc Auto merge of #38781 - SimonSapin:unishrink, r=alexcrichton 2017-01-07 21:28:47 +00:00
grammar Use keywords::Invalid 2016-11-27 17:59:36 +01:00
jemalloc@e058ca6616
liballoc Rollup merge of #38664 - apasel422:may-dangle, r=pnkfelix 2017-01-10 20:27:41 +09:00
liballoc_jemalloc Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
liballoc_system Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
libarena Rollup merge of #38664 - apasel422:may-dangle, r=pnkfelix 2017-01-10 20:27:41 +09:00
libbacktrace
libcollections Auto merge of #39062 - martinhath:placement-in-binaryheap, r=nagisa 2017-01-20 13:31:10 +00:00
libcollectionstest Auto merge of #39062 - martinhath:placement-in-binaryheap, r=nagisa 2017-01-20 13:31:10 +00:00
libcompiler_builtins Fix endian bugs in i128 intrinsic impls 2017-01-16 11:32:38 +02:00
libcore Auto merge of #37972 - bluss:iter-find-is-on-a-roll, r=sfackler 2017-01-17 21:52:03 +00:00
libcoretest Auto merge of #38982 - clarcharr:expect_err, r=aturon 2017-01-14 17:33:46 +00:00
libflate Remove not(stage0) from deny(warnings) 2016-12-29 21:07:20 -08:00
libfmt_macros Remove not(stage0) from deny(warnings) 2016-12-29 21:07:20 -08:00
libgetopts Remove not(stage0) from deny(warnings) 2016-12-29 21:07:20 -08:00
libgraphviz Remove not(stage0) from deny(warnings) 2016-12-29 21:07:20 -08:00
liblibc@7d57bdcdbb Properly ban the negation of unsigned integers in type-checking. 2017-01-03 21:48:17 +02:00
liblog Remove not(stage0) from deny(warnings) 2016-12-29 21:07:20 -08:00
libpanic_abort Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
libpanic_unwind Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
libproc_macro Refactor proc_macro::TokenStream to use syntax::tokenstream::TokenStream; fix tests for changed semantics 2017-01-15 23:11:50 -08:00
libproc_macro_plugin proc macros/qquote: Handle empty delimited tokens 2017-01-16 13:54:36 +13:00
libproc_macro_tokens proc macros/qquote: Handle empty delimited tokens 2017-01-16 13:54:36 +13:00
librand Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
librustc Auto merge of #38955 - estebank:highlighted-diags, r=nikomatsakis 2017-01-20 09:33:10 +00:00
librustc_back Disable jemalloc on s390x as well (closes #38596) 2017-01-12 19:33:40 +01:00
librustc_bitflags Remove not(stage0) from deny(warnings) 2016-12-29 21:07:20 -08:00
librustc_borrowck Auto merge of #38813 - eddyb:lazy-11, r=nikomatsakis 2017-01-08 11:36:52 +00:00
librustc_const_eval Fix two const-eval issues related to i128 negation 2017-01-11 19:38:44 +02:00
librustc_const_math Fix two const-eval issues related to i128 negation 2017-01-11 19:38:44 +02:00
librustc_data_structures Auto merge of #38610 - djzin:master, r=sfackler 2017-01-15 21:44:51 +00:00
librustc_driver Rollup merge of #38842 - abonander:proc_macro_attribute, r=jseyfried 2017-01-20 08:34:30 -08:00
librustc_errors Teach Diagnostics to highlight text 2017-01-17 14:28:53 -08:00
librustc_i128 Try to fix some things 2016-12-30 15:17:28 +01:00
librustc_incremental Auto merge of #39109 - michaelwoerister:incr-comp-cache-cleanup, r=nikomatsakis 2017-01-17 18:22:20 +00:00
librustc_lint Auto merge of #38813 - eddyb:lazy-11, r=nikomatsakis 2017-01-08 11:36:52 +00:00
librustc_llvm calling convention for MSP430 interrupts 2017-01-18 20:42:54 -05:00
librustc_metadata Implement #[proc_macro_attribute] 2017-01-16 22:41:22 -08:00
librustc_mir Rename ExprKind::Vec to Array in HIR and HAIR. 2017-01-16 00:45:51 -08:00
librustc_passes Rename ObjectSum into TraitObject in AST/HIR 2017-01-17 10:41:44 +03:00
librustc_platform_intrinsics Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
librustc_plugin Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
librustc_privacy AST/HIR: Replace Path with Type in WhereEqPredicate 2017-01-16 21:32:13 +03:00
librustc_resolve Implement #[proc_macro_attribute] 2017-01-16 22:41:22 -08:00
librustc_save_analysis save-analysis: handle paths in type/trait context more correctly 2017-01-10 16:09:13 +13:00
librustc_trans Auto merge of #38955 - estebank:highlighted-diags, r=nikomatsakis 2017-01-20 09:33:10 +00:00
librustc_typeck Rollup merge of #39149 - circuitfox:E0122-type-def-trait-bounds-where-clause, r=arielb1 2017-01-19 11:56:08 +01:00
librustdoc Auto merge of #39136 - keeperofdakeys:proc-macro-doc-test, r=alexcrichton 2017-01-19 21:15:12 +00:00
libserialize Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
libstd Rollup merge of #38761 - frewsxcv:thread-sleep-formatting, r=alexcrichton 2017-01-20 08:34:30 -08:00
libstd_unicode Implement Display for char Escape*, To*case. 2017-01-11 12:39:56 -05:00
libsyntax Rollup merge of #38842 - abonander:proc_macro_attribute, r=jseyfried 2017-01-20 08:34:30 -08:00
libsyntax_ext Rollup merge of #38842 - abonander:proc_macro_attribute, r=jseyfried 2017-01-20 08:34:30 -08:00
libsyntax_pos Remove not(stage0) from deny(warnings) 2016-12-29 21:07:20 -08:00
libterm Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
libtest Auto merge of #38779 - Craig-Macomber:bench, r=alexcrichton 2017-01-12 14:42:02 +00:00
libunwind Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
llvm@ceb177eeef Remove accidental submodule change. 2017-01-06 23:13:32 -05:00
rt Fix UB in test helpers 2017-01-16 11:46:00 +02:00
rtstartup Rename static mut to upper case 2016-10-14 17:21:11 +03:00
rust-installer@4f99485080
rustc std: Don't build docs for misc facade crates 2016-12-30 10:00:33 -08:00
rustllvm Fix covered-switch-default warnings in RustWrapper 2017-01-14 15:38:12 +01:00
test Rollup merge of #38842 - abonander:proc_macro_attribute, r=jseyfried 2017-01-20 08:34:30 -08:00
tools Rollup merge of #38842 - abonander:proc_macro_attribute, r=jseyfried 2017-01-20 08:34:30 -08:00
vendor rustbuild: Update gcc-rs to 0.3.40 2016-12-12 09:27:14 -08:00
Cargo.lock rustc: keep track of tables everywhere as if they were per-body. 2017-01-06 22:23:29 +02:00
Cargo.toml Update the bootstrap compiler 2016-11-30 10:38:08 -08:00
stage0.txt Bump bootstrap compiler 2016-12-29 08:47:20 -08:00