mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Fix test for changes in plugin API.
This commit is contained in:
parent
cf03f719d1
commit
803b9cd8ae
@ -205,7 +205,7 @@ fn plugin_deps() {
|
|||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
|
|
||||||
use rustc_driver::plugin::Registry;
|
use rustc_driver::plugin::Registry;
|
||||||
use syntax::tokenstream::TokenTree;
|
use syntax::tokenstream::TokenStream;
|
||||||
use syntax::source_map::Span;
|
use syntax::source_map::Span;
|
||||||
use syntax::ast::*;
|
use syntax::ast::*;
|
||||||
use syntax::ext::base::{ExtCtxt, MacEager, MacResult};
|
use syntax::ext::base::{ExtCtxt, MacEager, MacResult};
|
||||||
@ -215,7 +215,7 @@ fn plugin_deps() {
|
|||||||
reg.register_macro("bar", expand_bar);
|
reg.register_macro("bar", expand_bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
|
fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: TokenStream)
|
||||||
-> Box<MacResult + 'static> {
|
-> Box<MacResult + 'static> {
|
||||||
MacEager::expr(cx.expr_lit(sp, LitKind::Int(1, LitIntType::Unsuffixed)))
|
MacEager::expr(cx.expr_lit(sp, LitKind::Int(1, LitIntType::Unsuffixed)))
|
||||||
}
|
}
|
||||||
@ -301,7 +301,7 @@ fn plugin_to_the_max() {
|
|||||||
extern crate baz;
|
extern crate baz;
|
||||||
|
|
||||||
use rustc_driver::plugin::Registry;
|
use rustc_driver::plugin::Registry;
|
||||||
use syntax::tokenstream::TokenTree;
|
use syntax::tokenstream::TokenStream;
|
||||||
use syntax::source_map::Span;
|
use syntax::source_map::Span;
|
||||||
use syntax::ast::*;
|
use syntax::ast::*;
|
||||||
use syntax::ext::base::{ExtCtxt, MacEager, MacResult};
|
use syntax::ext::base::{ExtCtxt, MacEager, MacResult};
|
||||||
@ -312,7 +312,7 @@ fn plugin_to_the_max() {
|
|||||||
reg.register_macro("bar", expand_bar);
|
reg.register_macro("bar", expand_bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
|
fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: TokenStream)
|
||||||
-> Box<MacResult + 'static> {
|
-> Box<MacResult + 'static> {
|
||||||
let bar = Ident::from_str("baz");
|
let bar = Ident::from_str("baz");
|
||||||
let path = cx.path(sp, vec![bar.clone(), bar]);
|
let path = cx.path(sp, vec![bar.clone(), bar]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user