From 3c421ac67ef55541de73689f2f6bbabd7ddb0a9a Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Sat, 21 May 2016 01:58:42 +0000 Subject: [PATCH] Test diagnostics --- src/test/compile-fail/macro-error.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/compile-fail/macro-error.rs b/src/test/compile-fail/macro-error.rs index 817b675aedfe8..a69188da58d16 100644 --- a/src/test/compile-fail/macro-error.rs +++ b/src/test/compile-fail/macro-error.rs @@ -8,12 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Check that we report errors at macro definition, not expansion. +#![feature(type_macros)] macro_rules! foo { ($a:expr) => $a; //~ ERROR macro rhs must be delimited } fn main() { - foo!(0); + foo!(0); // Check that we report errors at macro definition, not expansion. + + let _: cfg!(foo) = (); //~ ERROR non-type macro in type position + derive!(); //~ ERROR `derive` can only be used in attributes }