Skip to content

Rust passes invalid syntax to procedural macros when expanding other macros #47358

Closed
@PlasmaPower

Description

@PlasmaPower

Here's an example of the issue: https://play.rust-lang.org/?gist=1fcdc0a76f5c4dd0f2da855e497ea298&version=stable

In that code I use #[doc=$doc], which is expanded to invalid syntax #[doc=concat!("Hello", "world", "!")] before being passed to the serde Deserialize procedural macro.

This uses the same expansion as #42164

Metadata

Metadata

Assignees

Labels

A-decl-macros-1-2Area: Declarative macros 1.2A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions