Skip to content
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

Add tests for nested macro_rules edition behavior #136509

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Feb 3, 2025

This adds tests to check the behavior of how nested macro_rules definitions work across edition boundaries. This covers a change in behavior due to #133274.

See #135669

@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 3, 2025
Comment on lines 5 to 7
//@ aux-crate: nested_macro_rules_dep_2021=nested_macro_rules_dep_2021.rs
//@ edition:2024
//@ check-pass
Copy link
Member

@jieyouxu jieyouxu Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: could this test be coalesced into the -2021 test to become one test with two differential revisions, with the "root" test crate being revisioned on edition 2021 vs 2024 to more obviously show the difference in behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Though I can't think of a way to extend that to the aux-crate, which is only differs in the edition.

Copy link
Member

@jieyouxu jieyouxu Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I can't think of a way to extend that to the aux-crate, which is only differs in the edition.

In theory they might be able to include! some common file and just differ in the compile-flags, but I don't foresee us changing these two aux files often anyways, so seems overkill and another layer of indirection. The current duplication seems completely fine.

@jieyouxu jieyouxu self-assigned this Feb 3, 2025
@ehuss ehuss force-pushed the nested-macro-rules-edition branch from 91129b9 to 3048aa2 Compare February 3, 2025 21:01
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, you can r=me after PR CI is green.

This adds tests to check the behavior of how nested macro_rules
definitions work across edition boundaries. This covers a change in
behavior due to rust-lang#133274.

See rust-lang#135669
@ehuss ehuss force-pushed the nested-macro-rules-edition branch from 3048aa2 to 4636dd9 Compare February 3, 2025 21:12
@jieyouxu
Copy link
Member

jieyouxu commented Feb 4, 2025

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 4, 2025

📌 Commit 4636dd9 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 4, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 4, 2025
…r=jieyouxu

Add tests for nested macro_rules edition behavior

This adds tests to check the behavior of how nested macro_rules definitions work across edition boundaries. This covers a change in behavior due to rust-lang#133274.

See rust-lang#135669
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang#128045 (#[contracts::requires(...)]  + #[contracts::ensures(...)])
 - rust-lang#136263 (rustdoc: clean up a bunch of ts-expected-error declarations in main)
 - rust-lang#136375 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 1))
 - rust-lang#136392 (bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros)
 - rust-lang#136405 (rustdoc-book: Clean up section on `--output-format`)
 - rust-lang#136497 (Report generic mismatches when calling bodyless trait functions)
 - rust-lang#136502 (Mark `std::fmt::from_fn` as `#[must_use]`)
 - rust-lang#136509 (Add tests for nested macro_rules edition behavior)
 - rust-lang#136526 (mir_build: Rename `thir::cx::Cx` to `ThirBuildCx` and remove `UserAnnotatedTyHelpers`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 5, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#128045 (#[contracts::requires(...)]  + #[contracts::ensures(...)])
 - rust-lang#136263 (rustdoc: clean up a bunch of ts-expected-error declarations in main)
 - rust-lang#136375 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 1))
 - rust-lang#136392 (bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros)
 - rust-lang#136396 (rustdoc-json-types: Document that crate name isn't package name.)
 - rust-lang#136405 (rustdoc-book: Clean up section on `--output-format`)
 - rust-lang#136502 (Mark `std::fmt::from_fn` as `#[must_use]`)
 - rust-lang#136509 (Add tests for nested macro_rules edition behavior)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c20a58d into rust-lang:master Feb 5, 2025
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 5, 2025
Rollup merge of rust-lang#136509 - ehuss:nested-macro-rules-edition, r=jieyouxu

Add tests for nested macro_rules edition behavior

This adds tests to check the behavior of how nested macro_rules definitions work across edition boundaries. This covers a change in behavior due to rust-lang#133274.

See rust-lang#135669
@rustbot rustbot added this to the 1.86.0 milestone Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants