From d1aa29ba3282662518e3b30e6db6f7af2b906356 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Tue, 26 Dec 2017 22:11:18 +0900 Subject: Do not panic on interpolated token inside quote macro --- src/test/compile-fail/quote-with-interpolated.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/compile-fail/quote-with-interpolated.rs (limited to 'src/test') diff --git a/src/test/compile-fail/quote-with-interpolated.rs b/src/test/compile-fail/quote-with-interpolated.rs new file mode 100644 index 00000000000..1fafb1c7a1b --- /dev/null +++ b/src/test/compile-fail/quote-with-interpolated.rs @@ -0,0 +1,19 @@ +// 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. + +#![feature(quote)] +fn main() { + macro_rules! foo { + ($bar:expr) => { + quote_expr!(cx, $bar) //~ ERROR quote! with interpolated token + } + } + foo!(bar); +} -- cgit 1.4.1-3-g733a5