Skip to content

global_asm expands arguments in comments #85944

Closed
@gz

Description

@gz

I tried this code:

#![feature(global_asm)]
global_asm!{r#"
// ${num}
/* ${num} */
"#}

I expected to see this happen: Compiles without error (on nightly)

Instead, this happened (not sure if this is intended behavior or a bug):

error: there is no argument named `num`
 --> src/lib.rs:3:5
  |
3 | // ${num}
  |     ^^^^^

error: there is no argument named `num`
 --> src/lib.rs:4:5
  |
4 | /* ${num} */
  |     ^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inline-assemblyArea: Inline assembly (`asm!(…)`)C-discussionCategory: Discussion or questions that doesn't represent real issues.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