-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Turn alloc's force_expr macro into a regular macro_rules. #81241
Conversation
Why not give it a more complicated name, like |
Sure, that makes a collision less likely, but we don't have any identifiers guaranteed to be reserved for the language/library implementation like C and C++ have. But yeah, if we can't find a better way, we should probably do that. |
That's not something that we can do anything about today and the "namespaced" name coupled with its inherent uselessness for anything beyond improving diagnostics makes the likelihood of this being a problem low. I am more concerned about not being able to remove this ever, so lets pick a name we can live with. |
So our options seem to be:
If these are our only options, the change in this PR seems like the best way forward for now (with a prefix as suggested in #81241 (comment)). If some kind of I'll update this PR and mark it as ready for review. |
Otherwise rust-analyzer doesn't understand vec![].
cdfabe8
to
1934eaf
Compare
r? @oli-obk |
Hm, if the removal of an otherwise hidden macro is a concern, we can revert #81080 and reintroduce in its current form once rust-analyzer can handle |
I don't see how removing this (unstable!) macro could be a breaking change, so... @bors r+ |
📌 Commit 1934eaf has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#80573 (Deny rustc::internal lints for rustdoc and clippy) - rust-lang#81173 (Expand docs on Iterator::intersperse) - rust-lang#81194 (Stabilize std::panic::panic_any.) - rust-lang#81202 (Don't prefix 0x for each segments in `dbg!(Ipv6)`) - rust-lang#81225 (Make 'docs' nullable in rustdoc-json output) - rust-lang#81227 (Remove doctree::StructType) - rust-lang#81233 (Document why not use concat! in dbg! macro) - rust-lang#81236 (Gracefully handle loop labels missing leading `'` in different positions) - rust-lang#81241 (Turn alloc's force_expr macro into a regular macro_rules.) - rust-lang#81242 (Enforce statically that `MIN_NON_ZERO_CAP` is calculated at compile time) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This turns
alloc
'sforce_expr
macro into a regularmacro_rules
.Otherwise rust-analyzer doesn't understand
vec![]
. See rust-lang/rust-analyzer#7349 and #81080 (comment)Edit: See #81241 (comment) for a discussion of alternatives.