From 98fd6a5c88a44214f15a43a9e633e3b71876bdb3 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Sat, 11 Jan 2020 16:21:30 +0100 Subject: 1. move allow_internal_unstable to rustc_attr 2. as a result, drop rustc_errors dep from syntax --- src/libsyntax/Cargo.toml | 1 - src/libsyntax/attr/mod.rs | 24 ------------------------ 2 files changed, 25 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/Cargo.toml b/src/libsyntax/Cargo.toml index b3e16f740fd..ff03ae3f425 100644 --- a/src/libsyntax/Cargo.toml +++ b/src/libsyntax/Cargo.toml @@ -13,7 +13,6 @@ doctest = false rustc_serialize = { path = "../libserialize", package = "serialize" } log = "0.4" scoped-tls = "1.0" -rustc_errors = { path = "../librustc_errors" } rustc_span = { path = "../librustc_span" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_index = { path = "../librustc_index" } diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index e4d4017a345..313f5269235 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -406,30 +406,6 @@ pub fn find_by_name(attrs: &[Attribute], name: Symbol) -> Option<&Attribute> { attrs.iter().find(|attr| attr.check_name(name)) } -pub fn allow_internal_unstable<'a>( - attrs: &[Attribute], - span_diagnostic: &'a rustc_errors::Handler, -) -> Option + 'a> { - find_by_name(attrs, sym::allow_internal_unstable).and_then(|attr| { - attr.meta_item_list() - .or_else(|| { - span_diagnostic - .span_err(attr.span, "allow_internal_unstable expects list of feature names"); - None - }) - .map(|features| { - features.into_iter().filter_map(move |it| { - let name = it.ident().map(|ident| ident.name); - if name.is_none() { - span_diagnostic - .span_err(it.span(), "`allow_internal_unstable` expects feature names") - } - name - }) - }) - }) -} - pub fn filter_by_name(attrs: &[Attribute], name: Symbol) -> impl Iterator { attrs.iter().filter(move |attr| attr.check_name(name)) } -- cgit 1.4.1-3-g733a5