From 54edfee71a7d2a8f710c578be75c0537a430eaaf Mon Sep 17 00:00:00 2001 From: Masaki Hara Date: Wed, 31 May 2017 19:24:01 +0900 Subject: Parse macros named "default" correctly. --- src/test/run-pass/macro-named-default.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/test/run-pass/macro-named-default.rs (limited to 'src/test') diff --git a/src/test/run-pass/macro-named-default.rs b/src/test/run-pass/macro-named-default.rs new file mode 100644 index 00000000000..028d59a19dd --- /dev/null +++ b/src/test/run-pass/macro-named-default.rs @@ -0,0 +1,27 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! default { + ($($x:tt)*) => { $($x)* } +} + +default! { + struct A; +} + +impl A { + default! { + fn foo(&self) {} + } +} + +fn main() { + A.foo(); +} -- cgit 1.4.1-3-g733a5