From bd98a935587ad988b5780b75021b1a45d0f508d7 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Fri, 26 Jan 2018 17:08:50 -0600 Subject: [PATCH] Fix more tests --- src/test/compile-fail/macro-at-most-once-rep-ambig.rs | 2 ++ .../auxiliary/procedural_mbe_matching.rs | 9 ++++++++- src/test/run-pass/macro-at-most-once-rep.rs | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/test/compile-fail/macro-at-most-once-rep-ambig.rs b/src/test/compile-fail/macro-at-most-once-rep-ambig.rs index c745568f1ca..6886a02cb92 100644 --- a/src/test/compile-fail/macro-at-most-once-rep-ambig.rs +++ b/src/test/compile-fail/macro-at-most-once-rep-ambig.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(macro_at_most_once_rep)] + macro_rules! foo { ($(a)?) => {} } diff --git a/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs b/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs index b5d6ff595af..9ebc438ad5a 100644 --- a/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs +++ b/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs @@ -18,6 +18,7 @@ extern crate rustc; extern crate rustc_plugin; +use syntax::feature_gate::Features; use syntax::parse::token::{NtExpr, NtPat}; use syntax::ast::{Ident, Pat}; use syntax::tokenstream::{TokenTree}; @@ -31,11 +32,17 @@ use syntax_pos::Span; use rustc_plugin::Registry; +use std::cell::RefCell; + fn expand_mbe_matches(cx: &mut ExtCtxt, _: Span, args: &[TokenTree]) -> Box { let mbe_matcher = quote_tokens!(cx, $$matched:expr, $$($$pat:pat)|+); - let mbe_matcher = quoted::parse(mbe_matcher.into_iter().collect(), true, cx.parse_sess); + let mbe_matcher = quoted::parse(mbe_matcher.into_iter().collect(), + true, + cx.parse_sess, + &RefCell::new(Features::new()), + &[]); let map = match TokenTree::parse(cx, &mbe_matcher, args.iter().cloned().collect()) { Success(map) => map, Failure(_, tok) => { diff --git a/src/test/run-pass/macro-at-most-once-rep.rs b/src/test/run-pass/macro-at-most-once-rep.rs index 823f42c4544..ecfa92d5a73 100644 --- a/src/test/run-pass/macro-at-most-once-rep.rs +++ b/src/test/run-pass/macro-at-most-once-rep.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(macro_at_most_once_rep)] + macro_rules! foo { ($(a)?) => {} }