Skip to content

Commit a6afe8d

Browse files
committed
quickcheck_macros: Update for rust-lang/rust#37824
“Clean up `ast::Attribute`, `ast::CrateConfig`, and string interning” Resolves these errors: error[E0425]: unresolved name `token::intern` --> src/lib.rs:27:35 | 27 | reg.register_syntax_extension(token::intern("quickcheck"), | ^^^^^^^^^^^^^ unresolved name error[E0425]: unresolved name `token::str_to_ident` --> src/lib.rs:86:23 | 86 | let check_ident = token::str_to_ident("quickcheck"); | ^^^^^^^^^^^^^^^^^^^ unresolved name error[E0425]: unresolved name `token::intern_and_get_ident` --> src/lib.rs:107:34 | 107 | span, cx.meta_word(span, token::intern_and_get_ident("test")))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ unresolved name error: aborting due to 3 previous errors Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 1e9321c commit a6afe8d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

quickcheck_macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ path = "examples/attribute.rs"
2121

2222
[dependencies.quickcheck]
2323
path = ".."
24-
version = "0.3"
24+
version = "0.4"

quickcheck_macros/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ extern crate syntax;
1111
extern crate rustc_plugin;
1212

1313
use syntax::ast;
14-
use syntax::ast::{ItemKind, StmtKind, Stmt, TyKind};
14+
use syntax::ast::{Ident, ItemKind, StmtKind, Stmt, TyKind};
1515
use syntax::codemap;
16-
use syntax::parse::token;
1716
use syntax::ext::base::{ExtCtxt, MultiModifier, Annotatable};
1817
use syntax::ext::build::AstBuilder;
1918
use syntax::ptr::P;
19+
use syntax::symbol::Symbol;
2020

2121
use rustc_plugin::Registry;
2222

2323
/// For the `#[quickcheck]` attribute. Do not use.
2424
#[plugin_registrar]
2525
#[doc(hidden)]
2626
pub fn plugin_registrar(reg: &mut Registry) {
27-
reg.register_syntax_extension(token::intern("quickcheck"),
27+
reg.register_syntax_extension(Symbol::intern("quickcheck"),
2828
MultiModifier(Box::new(expand_meta_quickcheck)));
2929
}
3030

@@ -83,7 +83,7 @@ fn wrap_item(cx: &mut ExtCtxt,
8383
// Copy original function without attributes
8484
let prop = P(ast::Item {attrs: Vec::new(), ..item.clone()});
8585
// ::quickcheck::quickcheck
86-
let check_ident = token::str_to_ident("quickcheck");
86+
let check_ident = Ident::from_str("quickcheck");
8787
let check_path = vec!(check_ident, check_ident);
8888
// Wrap original function in new outer function,
8989
// calling ::quickcheck::quickcheck()
@@ -104,7 +104,7 @@ fn wrap_item(cx: &mut ExtCtxt,
104104
let mut attrs = item.attrs.clone();
105105
// Add #[test] attribute
106106
attrs.push(cx.attribute(
107-
span, cx.meta_word(span, token::intern_and_get_ident("test"))));
107+
span, cx.meta_word(span, Symbol::intern("test"))));
108108
// Attach the attributes to the outer function
109109
Annotatable::Item(P(ast::Item {attrs: attrs, ..(*test).clone()}))
110110
}

0 commit comments

Comments
 (0)