From 7767e7fb165d527f1991175809a361f2d2313b80 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Wed, 21 Aug 2019 02:23:46 +0200 Subject: Stabilize `str::len`, `[T]::len`, `is_empty` and `str::as_bytes` as const fn --- src/libsyntax/ext/base.rs | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index a6be5b10178..e189d8f8636 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -762,33 +762,9 @@ impl SyntaxExtension { name: Name, attrs: &[ast::Attribute], ) -> SyntaxExtension { - let allow_internal_unstable = - attr::find_by_name(attrs, sym::allow_internal_unstable).map(|attr| { - attr.meta_item_list() - .map(|list| { - list.iter() - .filter_map(|it| { - let name = it.ident().map(|ident| ident.name); - if name.is_none() { - sess.span_diagnostic.span_err( - it.span(), "allow internal unstable expects feature names" - ) - } - name - }) - .collect::>() - .into() - }) - .unwrap_or_else(|| { - sess.span_diagnostic.span_warn( - attr.span, - "allow_internal_unstable expects list of feature names. In the future \ - this will become a hard error. Please use `allow_internal_unstable(\ - foo, bar)` to only allow the `foo` and `bar` features", - ); - vec![sym::allow_internal_unstable_backcompat_hack].into() - }) - }); + let allow_internal_unstable = attr::allow_internal_unstable( + &attrs, &sess.span_diagnostic, + ).map(|features| features.collect::>().into()); let mut local_inner_macros = false; if let Some(macro_export) = attr::find_by_name(attrs, sym::macro_export) { -- cgit 1.4.1-3-g733a5