-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Tracking issue for builtin declarative macros #2212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
After #2205 is landed, some of the builtin declarative macros are: Trivial to implement:
Trivial to implement for IDE purpose: (A dummy implementation will work here)
Need
Need eager macro expansion support: |
Priority wise, handling |
I will take But I still can't figure it out how name resolution works inside inner expansion phase 🤣 |
2348: Add support for stringify! builtin macro r=matklad a=piotr-szpetkowski Refs #2212 First time ever contributing here, hopefully it's ok. 2352: Move TypeAlias to hir_def r=matklad a=matklad Co-authored-by: Piotr Szpetkowski <[email protected]> Co-authored-by: Aleksey Kladov <[email protected]>
2348: Add support for stringify! builtin macro r=matklad a=piotr-szpetkowski Refs #2212 First time ever contributing here, hopefully it's ok. 2352: Move TypeAlias to hir_def r=matklad a=matklad Co-authored-by: Piotr Szpetkowski <[email protected]> Co-authored-by: Aleksey Kladov <[email protected]>
@edwin0cheng what does |
Um... something as |
Yeah, I think |
NOTE: This might be out of scope for this issue, so feel free to let me know and I'll create a separate issue. With Rust 1.54 recently introducing support for Take for example the following code: /// The GraphQL schema for our mock service.
///
/// ```graphql
#[doc = include_str!("schema.graphql")]
/// ```
pub struct Query; It pulls in an external file, If you run |
Here is the full list of builtin declarative macros current rustc supported:
asm
: asm::expand_asmassert
: assert::expand_assertcfg
: cfg::expand_cfg (Implement builtincfg!
macro #7964)column
: source_util::expand_column (Expand column!() #2355 by @kjeremy)compile_error
: compile_error::expand_compile_error (Expand compile_error! #2362 by @kjeremy)concat_idents
: concat_idents::expand_concat_identsconcat
: concat::expand_concat(Implement concat eager macro #3392 by @edwin0cheng)env
: env::expand_env(Implement env! macro #3549 by @edwin0cheng)file
: source_util::expand_file (Expand file! to dummy "" #2357 by @kjeremy)format_args_nl
: format::expand_format_args_nl (Implementformat_args
#2489 by @flodiebold)format_args
: format::expand_format_args (Implementformat_args
#2489 by @flodiebold)global_asm
: global_asm::expand_global_asminclude_bytes
: source_util::expand_include_bytes(Add support for include_bytes! #5102 by @lnicola)include_str
: source_util::expand_include_str (Add support for include_str #5100 by @lnicola)include
: source_util::expand_include (Implement include macro #3494 by @edwin0cheng)line
: source_util::expand_line (Implement bulitin line! macro #2205 @edwin0cheng)log_syntax
: log_syntax::expand_log_syntaxmodule_path
: source_util::expand_mod (Implementmodule_path!()
#6874)option_env
: env::expand_option_env(Implement env! macro #3549 by @edwin0cheng)stringify
: source_util::expand_stringify (Add support for stringify! builtin macro #2348 by @piotr-szpetkowski)trace_macros
: trace_macros::expand_trace_macrosThe text was updated successfully, but these errors were encountered: