rust/compiler/rustc_expand/src
Nika Layzell 3e4d3d2a29 proc_macro: Add an expand_expr method to TokenStream
This feature is aimed at giving proc macros access to powers similar to
those used by builtin macros such as `format_args!` or `concat!`. These
macros are able to accept macros in place of string literal parameters,
such as the format string, as they perform recursive macro expansion
while being expanded.

This can be especially useful in many cases thanks to helper macros like
`concat!`, `stringify!` and `include_str!` which are often used to
construct string literals at compile-time in user code.

For now, this method only allows expanding macros which produce
literals, although more expresisons will be supported before the method
is stabilized.
2021-11-12 15:41:40 -05:00
..
mbe Rollup merge of #89991 - petrochenkov:visitok2, r=jackh726 2021-10-22 19:42:48 +09:00
mut_visit rustc_ast: Turn MutVisitor::token_visiting_enabled into a constant 2021-10-18 00:23:24 +03:00
parse Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
tokenstream Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
base.rs Auto merge of #84373 - cjgillot:resolve-span, r=michaelwoerister,petrochenkov 2021-09-11 23:35:28 +00:00
build.rs Detect bare blocks with type ascription that were meant to be a struct literal 2021-09-03 14:43:04 +00:00
config.rs clippy::complexity changes 2021-10-16 18:11:16 +02:00
expand.rs Auto merge of #89933 - est31:let_else, r=michaelwoerister 2021-10-19 14:41:39 +00:00
lib.rs Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
mbe.rs fix few typos 2021-04-19 15:57:08 +03:00
module.rs Check for macros in built-in attributes that don't support them. 2021-09-25 09:03:15 -07:00
placeholders.rs rustc_span: Ident::invalid -> Ident::empty 2021-10-17 23:20:30 +03:00
proc_macro.rs proc_macro: Add an expand_expr method to TokenStream 2021-11-12 15:41:40 -05:00
proc_macro_server.rs proc_macro: Add an expand_expr method to TokenStream 2021-11-12 15:41:40 -05:00
tests.rs Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00