-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add macro test for min-const-generics #78912
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
|
||
let _ok = Example::<{ external_macro!() }>; | ||
|
||
let _fail = Example::<external_macro!()>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's interesting that this fails 🤔 cc @petrochenkov @varkor what would be needed to get this to work?
Might be good to open an separate issue for this.
Would this also need an GenericArg::Ambiguous
variant in the AST?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
external_macro!()
is not a literal or block expression, so it's being parsed as a type argument. This is behaving as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but if the macro itself returns a block, it doesn't seem that that gets parsed as a const. It's fine if this is the intended behavior, just a bit surprising
2c1e603
to
48b71a7
Compare
c036a19
to
504f435
Compare
thanks @bors r+ rollup |
📌 Commit 504f435df041c565847b6b0e4d06df48431fc9ad has been approved by |
🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened |
@bors r- |
504f435
to
857dd8b
Compare
👍 @bors r+ rollup |
📌 Commit 857dd8b has been approved by |
🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened |
…as-schievink Rollup of 14 pull requests Successful merges: - rust-lang#76765 (Make it more clear what an about async fn's returns when referring to what it returns) - rust-lang#78574 (Use check-pass instead of build-pass in regions ui test suite) - rust-lang#78669 (Use check-pass instead of build-pass in some consts ui test suits) - rust-lang#78847 (Assert that a return place is not used for indexing during integration) - rust-lang#78854 (Workaround for "could not fully normalize" ICE ) - rust-lang#78875 (rustc_target: Further cleanup use of target options) - rust-lang#78887 (Add comments to explain memory usage optimization) - rust-lang#78890 (comment attribution fix) - rust-lang#78896 (Clarified description of write! macro) - rust-lang#78897 (Add missing newline to error message of the default OOM hook) - rust-lang#78898 (add regression test for rust-lang#78892) - rust-lang#78908 ((rustdoc) [src] link for types defined by macros shows invocation, not defintion) - rust-lang#78910 (Fix links to stabilized versions of some intrinsics) - rust-lang#78912 (Add macro test for min-const-generics) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Adds a test which uses a macro inside a block for a const-expression, as per #78433
r? @lcnr