diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-28 10:38:19 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-28 10:38:19 +0000 |
| commit | 6303640e856dc3cccea655df104203649b5efd76 (patch) | |
| tree | 7cb01f242a73cfc7c319708e1674b58eb8a7b4f5 /src/test/compile-fail-fulldeps | |
| parent | 413ecdee30d76eeed574bc9af547b539bc511863 (diff) | |
| parent | 8250a26b5bcea9190ac63e756c35d8a54bf9da0c (diff) | |
| download | rust-6303640e856dc3cccea655df104203649b5efd76.tar.gz rust-6303640e856dc3cccea655df104203649b5efd76.zip | |
Rollup merge of #35850 - SergioBenitez:master, r=nrc
Implement RFC#1559: allow all literals in attributes Implemented rust-lang/rfcs#1559, tracked by #34981.
Diffstat (limited to 'src/test/compile-fail-fulldeps')
| -rw-r--r-- | src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs b/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs index a6bc9db199c..6db10eeae76 100644 --- a/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs +++ b/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs @@ -17,7 +17,8 @@ extern crate syntax_pos; extern crate rustc; extern crate rustc_plugin; -use syntax::ast::{self, Item, MetaItem, ImplItem, TraitItem, ItemKind}; +use syntax::ast::{self, Item, MetaItem, ItemKind}; +use syntax::attr::{AttrMetaMethods, AttrNestedMetaItemMethods}; use syntax::ext::base::*; use syntax::parse::{self, token}; use syntax::ptr::P; @@ -62,8 +63,8 @@ fn expand_identity(cx: &mut ExtCtxt, _span: Span, tts: &[TokenTree]) } fn expand_into_foo_multi(cx: &mut ExtCtxt, - sp: Span, - attr: &MetaItem, + _sp: Span, + _attr: &MetaItem, it: Annotatable) -> Annotatable { match it { Annotatable::Item(it) => { @@ -72,7 +73,7 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt, ..(*quote_item!(cx, enum Foo2 { Bar2, Baz2 }).unwrap()).clone() })) } - Annotatable::ImplItem(it) => { + Annotatable::ImplItem(_) => { quote_item!(cx, impl X { fn foo(&self) -> i32 { 42 } }).unwrap().and_then(|i| { match i.node { ItemKind::Impl(_, _, _, _, _, mut items) => { @@ -82,7 +83,7 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt, } }) } - Annotatable::TraitItem(it) => { + Annotatable::TraitItem(_) => { quote_item!(cx, trait X { fn foo(&self) -> i32 { 0 } }).unwrap().and_then(|i| { match i.node { ItemKind::Trait(_, _, _, mut items) => { @@ -97,15 +98,15 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt, // Create a duplicate of the annotatable, based on the MetaItem fn expand_duplicate(cx: &mut ExtCtxt, - sp: Span, + _sp: Span, mi: &MetaItem, it: &Annotatable, push: &mut FnMut(Annotatable)) { let copy_name = match mi.node { ast::MetaItemKind::List(_, ref xs) => { - if let ast::MetaItemKind::Word(ref w) = xs[0].node { - token::str_to_ident(&w) + if let Some(word) = xs[0].word() { + token::str_to_ident(&word.name()) } else { cx.span_err(mi.span, "Expected word"); return; |
