rust/src/test/ui-fulldeps
Alex Crichton 79630d4fdf 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-20 19:56:16 -07:00
..
auxiliary Add several lints into unused lint group 2017-10-29 22:14:23 +03:00
custom-derive Update tests 2018-03-16 11:52:46 +01:00
proc-macro rustc: Tweak custom attribute capabilities 2018-04-20 19:56:16 -07:00
deprecated-derive.rs Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516. 2017-06-02 23:28:22 +08:00
deprecated-derive.stderr Update UI tests 2018-02-26 20:24:02 +03:00
lint-group-plugin.rs Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516. 2017-06-02 23:28:22 +08:00
lint-group-plugin.stderr Update UI tests 2018-02-26 20:24:02 +03:00
lint-plugin-cmdline-allow.rs rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
lint-plugin-cmdline-allow.stderr Update UI tests 2018-02-26 20:24:02 +03:00
lint-plugin-cmdline-load.rs Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516. 2017-06-02 23:28:22 +08:00
lint-plugin-cmdline-load.stderr Update UI tests 2018-02-26 20:24:02 +03:00
lint-plugin-forbid-attrs.rs Do the same things for fulldeps tests 2017-12-14 23:26:40 +03:00
lint-plugin-forbid-attrs.stderr update tests 2018-03-14 00:53:24 +01:00
lint-plugin.rs Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516. 2017-06-02 23:28:22 +08:00
lint-plugin.stderr Update UI tests 2018-02-26 20:24:02 +03:00
resolve-error.rs Merge cfail and ui tests into ui tests 2017-11-24 11:32:35 +01:00
resolve-error.stderr Update UI tests 2018-02-26 20:24:02 +03:00
update-all-references.sh Do the same things for fulldeps tests 2017-12-14 23:26:40 +03:00
update-references.sh Make ui-fulldeps/update-references executable 2018-01-15 08:09:55 +11:00