Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ script:
- cargo build --verbose
- cargo test --verbose
- cargo doc
- if [ "$TEST_SUITE" = "suite_nightly" ]; then
- if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
cargo build --verbose --manifest-path quickcheck_macros/Cargo.toml;
cargo test --verbose --manifest-path quickcheck_macros/Cargo.toml;
fi
2 changes: 1 addition & 1 deletion quickcheck_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ path = "examples/attribute.rs"

[dependencies.quickcheck]
path = ".."
version = "0.3"
version = "0.4"
10 changes: 5 additions & 5 deletions quickcheck_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ extern crate syntax;
extern crate rustc_plugin;

use syntax::ast;
use syntax::ast::{ItemKind, StmtKind, Stmt, TyKind};
use syntax::ast::{Ident, ItemKind, StmtKind, Stmt, TyKind};
use syntax::codemap;
use syntax::parse::token;
use syntax::ext::base::{ExtCtxt, MultiModifier, Annotatable};
use syntax::ext::build::AstBuilder;
use syntax::ptr::P;
use syntax::symbol::Symbol;

use rustc_plugin::Registry;

/// For the `#[quickcheck]` attribute. Do not use.
#[plugin_registrar]
#[doc(hidden)]
pub fn plugin_registrar(reg: &mut Registry) {
reg.register_syntax_extension(token::intern("quickcheck"),
reg.register_syntax_extension(Symbol::intern("quickcheck"),
MultiModifier(Box::new(expand_meta_quickcheck)));
}

Expand Down Expand Up @@ -83,7 +83,7 @@ fn wrap_item(cx: &mut ExtCtxt,
// Copy original function without attributes
let prop = P(ast::Item {attrs: Vec::new(), ..item.clone()});
// ::quickcheck::quickcheck
let check_ident = token::str_to_ident("quickcheck");
let check_ident = Ident::from_str("quickcheck");
let check_path = vec!(check_ident, check_ident);
// Wrap original function in new outer function,
// calling ::quickcheck::quickcheck()
Expand All @@ -104,7 +104,7 @@ fn wrap_item(cx: &mut ExtCtxt,
let mut attrs = item.attrs.clone();
// Add #[test] attribute
attrs.push(cx.attribute(
span, cx.meta_word(span, token::intern_and_get_ident("test"))));
span, cx.meta_word(span, Symbol::intern("test"))));
// Attach the attributes to the outer function
Annotatable::Item(P(ast::Item {attrs: attrs, ..(*test).clone()}))
}