From 5354317037368124d180acc3f8754bdb2b0387b8 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 9 Feb 2015 09:29:21 -0800 Subject: Process cfg_attr right before stripping cfg Fixes #22070. Fixes #19372. --- src/libsyntax/ext/cfg_attr.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 src/libsyntax/ext/cfg_attr.rs (limited to 'src/libsyntax/ext/cfg_attr.rs') diff --git a/src/libsyntax/ext/cfg_attr.rs b/src/libsyntax/ext/cfg_attr.rs deleted file mode 100644 index 72eaa3e47be..00000000000 --- a/src/libsyntax/ext/cfg_attr.rs +++ /dev/null @@ -1,34 +0,0 @@ -// 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use ast; -use attr; -use codemap::Span; -use ext::base::ExtCtxt; -use ext::build::AstBuilder; -use ptr::P; - -pub fn expand(cx: &mut ExtCtxt, sp: Span, mi: &ast::MetaItem, it: P) -> P { - let (cfg, attr) = match mi.node { - ast::MetaList(_, ref mis) if mis.len() == 2 => (&mis[0], &mis[1]), - _ => { - cx.span_err(sp, "expected `#[cfg_attr(, )]`"); - return it; - } - }; - - let mut out = (*it).clone(); - if attr::cfg_matches(&cx.parse_sess.span_diagnostic, &cx.cfg, &**cfg) { - out.attrs.push(cx.attribute(attr.span, attr.clone())); - } - - P(out) -} - -- cgit 1.4.1-3-g733a5