]> git.lizzy.rs Git - rust.git/blob - src/test/ui/proc-macro/dollar-crate.rs
async/await: improve obligation errors
[rust.git] / src / test / ui / proc-macro / dollar-crate.rs
1 // edition:2018
2 // aux-build:test-macros.rs
3 // aux-build:dollar-crate-external.rs
4
5 // Anonymize unstable non-dummy spans while still showing dummy spans `0..0`.
6 // normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)"
7 // normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)"
8
9 #[macro_use]
10 extern crate test_macros;
11 extern crate dollar_crate_external;
12
13 type S = u8;
14
15 mod local {
16     macro_rules! local {
17         () => {
18             print_bang! {
19                 struct M($crate::S);
20             }
21
22             #[print_attr]
23             struct A($crate::S);
24
25             #[derive(Print)]
26             struct D($crate::S); //~ ERROR the name `D` is defined multiple times
27         };
28     }
29
30     local!();
31 }
32
33 mod external {
34     use crate::dollar_crate_external;
35
36     dollar_crate_external::external!(); //~ ERROR the name `D` is defined multiple times
37 }
38
39 fn main() {}