Skip to content

Nom breaks dbg macro from std #1022

@chifflier

Description

@chifflier

Nom defines a dbg macro, which unfortunately breaks the same macro from std (even without adding a use for it, it seems the namespaces aren't working as expected).

Minimal code to reproduce (nom 5.0, rustc 1.37):

#[macro_use]
extern crate nom;

fn test() {
    let a = 1;
    dbg!(&a);
}

fails with error:

error: unexpected end of macro invocation
 --> tests/nom.rs:7:12
  |
7 |     dbg!(&a);
  |            ^ missing tokens in macro arguments

Suggestion: rename dbg
Workaround: replace line with ::std::dbg!(&a)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions