Skip to content

Allow interpolated paths after use during macro expansion. #10415

Closed

Description

@brendanzab
#![feature(macro_rules)]

macro_rules! use_path(($p:path) => (use $p;))

use_path!(std::uint)

fn main() {
    let _ = uint::max_value;
}
<anon>:3:42: 3:43 error: expected ident, found `std::uint`
<anon>:3 macro_rules! use_path(($p:path) => (use $p;))
                                                  ^

Activity

  1. huonw commented on Aug 4, 2014

    @huonw
    Contributor

    Triage, the error message has improved slightly, but no change (I updated the example code & diagnostics). It's worth noting that import paths are actually different to normal paths, since e.g. foo::<T>::bar::<U> is a valid path, but not a valid import path.

    (For completeness, I believe there's no import paths that are invalid normal paths, e.g. super::super::foo() is a valid expression.)

  2. steveklabnik commented on Apr 30, 2015

    @steveklabnik
    Contributor

    Triage: no change

  3. added
    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
    and removed on Jun 29, 2015
  4. added a commit that references this issue on Apr 17, 2016
  5. added a commit that references this issue on Mar 10, 2023
  6. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions