-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Change the syntax of the internal weak!
macro
#138988
Conversation
This comment has been minimized.
This comment has been minimized.
Change the syntax to include parameter names and a trailing semicolon. Motivation: - Mirror the `syscall!` macro. - Allow rustfmt to format it (when wrapped in parentheses). - For better documentation (having the parameter names available in the source code is a bit nicer). - Allow future improvements to this macro where we can sometimes use the symbol directly when it's statically known to be available.
1592f5c
to
a7bafc0
Compare
I like this idea. I actually noticed recently too, but I took a slightly different approach in a draft patch. Since Also, I like that you're adding parameter names. |
Yes: |
This makes sense to me, thanks! @bors r+ rollup |
…, r=ibraheemdev Change the syntax of the internal `weak!` macro Change the syntax to include parameter names and a trailing semicolon. Motivation: - Mirror the `syscall!` macro. - Allow rustfmt to format it (when wrapped in parentheses, and when not inside `cfg_if!`). - For better documentation (having the parameter names available in the source code is a bit nicer). - Allow a future improvement to this macro where we can sometimes use the symbol directly when it's statically known to be available (and thus need the parameter names to be available), see rust-lang#136868. r? libs
Rollup of 8 pull requests Successful merges: - rust-lang#138692 (Reject `{true,false}` as revision names) - rust-lang#138757 (wasm: increase default thread stack size to 1 MB) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#138988 (Change the syntax of the internal `weak!` macro) - rust-lang#139044 (bootstrap: Avoid cloning `change-id` list) - rust-lang#139056 (use `try_fold` instead of `fold`) - rust-lang#139057 (use `slice::contains` where applicable) - rust-lang#139086 (Various cleanup in ExprUseVisitor) r? `@ghost` `@rustbot` modify labels: rollup
…, r=ibraheemdev Change the syntax of the internal `weak!` macro Change the syntax to include parameter names and a trailing semicolon. Motivation: - Mirror the `syscall!` macro. - Allow rustfmt to format it (when wrapped in parentheses, and when not inside `cfg_if!`). - For better documentation (having the parameter names available in the source code is a bit nicer). - Allow a future improvement to this macro where we can sometimes use the symbol directly when it's statically known to be available (and thus need the parameter names to be available), see rust-lang#136868. r? libs
Rollup of 7 pull requests Successful merges: - rust-lang#138692 (Reject `{true,false}` as revision names) - rust-lang#138757 (wasm: increase default thread stack size to 1 MB) - rust-lang#138988 (Change the syntax of the internal `weak!` macro) - rust-lang#139044 (bootstrap: Avoid cloning `change-id` list) - rust-lang#139056 (use `try_fold` instead of `fold`) - rust-lang#139057 (use `slice::contains` where applicable) - rust-lang#139086 (Various cleanup in ExprUseVisitor) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#138692 (Reject `{true,false}` as revision names) - rust-lang#138757 (wasm: increase default thread stack size to 1 MB) - rust-lang#138988 (Change the syntax of the internal `weak!` macro) - rust-lang#139056 (use `try_fold` instead of `fold`) - rust-lang#139057 (use `slice::contains` where applicable) - rust-lang#139086 (Various cleanup in ExprUseVisitor) - rust-lang#139097 (Add more tests for pin!().) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#138988 - madsmtm:internal-weak-macro-syntax, r=ibraheemdev Change the syntax of the internal `weak!` macro Change the syntax to include parameter names and a trailing semicolon. Motivation: - Mirror the `syscall!` macro. - Allow rustfmt to format it (when wrapped in parentheses, and when not inside `cfg_if!`). - For better documentation (having the parameter names available in the source code is a bit nicer). - Allow a future improvement to this macro where we can sometimes use the symbol directly when it's statically known to be available (and thus need the parameter names to be available), see rust-lang#136868. r? libs
Change the syntax to include parameter names and a trailing semicolon.
Motivation:
syscall!
macro.cfg_if!
).cfg_os_version_min
instd
#136868.r? libs