summaryrefslogtreecommitdiffstats
path: root/src/test/ui/imports/extern-crate-self/extern-crate-self-macro-alias.rs
blob: 79683522888cbeffa958ef76daa823aa377271af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-pass

// Test that a macro can correctly expand the alias
// in an `extern crate self as ALIAS` item.

fn the_answer() -> usize { 42 }

macro_rules! alias_self {
    ($alias:ident) => { extern crate self as $alias; }
}

alias_self!(the_alias);

fn main() {
    assert_eq!(the_alias::the_answer(), 42);
}