Skip to content

Commit

Permalink
Auto merge of #133274 - ehuss:macro_rules-edition-from-pm, r=compiler…
Browse files Browse the repository at this point in the history
…-errors

Use edition of `macro_rules` when compiling the macro

This changes the edition assigned to a macro_rules macro when it is compiled to use the edition of where the macro came from instead of the local crate's edition.

This fixes a problem when a macro_rules macro is created by a proc-macro. Previously that macro would be tagged with the local edition, which would cause problems with using the correct edition behavior inside the macro. For example, the check for unsafe attributes would cause errors in 2024 when using proc-macros from older editions.

This is partially related to rust-lang/rust#132906. Unfortunately this is only a half fix for that issue. It fixes the error that happens in 2024, but does not fix the lint firing in 2021. I'm still trying to think of some way to fix that, but I'm running low on ideas.
  • Loading branch information
bors committed Nov 27, 2024
2 parents 3d802a9 + fb995b4 commit 7e5d40a
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 7e5d40a

Please sign in to comment.