Skip to content

Hygiene Example Typo #74118

Closed
Closed

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsArea: 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