Skip to content

Hygiene Example Typo #74118

Closed
Closed
@BeniReydman

Description

@BeniReydman

What needs to be fixed?

In the Rust book under Hygiene section for the following code:

macro_rules! foo {
    ($v:ident) => (let $v = 3);
}

fn main() {
    foo!(x);
    println!("{}", x);
}

There is missing a semi-colon at the line let $v = 3 which doesn't compile in Rust Playground

Page(s) Affected

https://doc.rust-lang.org/1.7.0/book/macros.html#hygiene

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions