diff options
| author | Piotr Jawniak <sawyer47@gmail.com> | 2014-07-19 11:59:44 +0200 |
|---|---|---|
| committer | Piotr Jawniak <sawyer47@gmail.com> | 2014-07-20 08:47:14 +0200 |
| commit | 20df4ccafe4d3eb588fa309f06d41aa6b5b1d526 (patch) | |
| tree | dcb6e5a6d8722ea4cb61377794ea0663315cb326 /src/test | |
| parent | 44a71dee377bebd39a45ba3fe0ccc31e59ac2821 (diff) | |
| download | rust-20df4ccafe4d3eb588fa309f06d41aa6b5b1d526.tar.gz rust-20df4ccafe4d3eb588fa309f06d41aa6b5b1d526.zip | |
Correctly stringify! types and paths inside macros
Closes #8709
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/issue-8709.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-8709.rs b/src/test/run-pass/issue-8709.rs new file mode 100644 index 00000000000..9f2aaa4d005 --- /dev/null +++ b/src/test/run-pass/issue-8709.rs @@ -0,0 +1,24 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(macro_rules)] + +macro_rules! sty( + ($t:ty) => (stringify!($t)) +) + +macro_rules! spath( + ($t:path) => (stringify!($t)) +) + +fn main() { + assert_eq!(sty!(int), "int") + assert_eq!(spath!(std::option), "std::option") +} |
