Skip to content

Commit 9e4b325

Browse files
committed
Auto merge of #4838 - Manishearth:die-qquote, r=alexcrichton
Remove usage of quasi-quoting in tests Only clippy and cargo use the old quasi quoting stuff, and we should be removing it. r? @alexcrichton
2 parents 26f768f + 5f76583 commit 9e4b325

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/cross-compile.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ fn plugin_deps() {
164164
use rustc_plugin::Registry;
165165
use syntax::tokenstream::TokenTree;
166166
use syntax::codemap::Span;
167+
use syntax::ast::*;
167168
use syntax::ext::base::{ExtCtxt, MacEager, MacResult};
169+
use syntax::ext::build::AstBuilder;
168170
169171
#[plugin_registrar]
170172
pub fn foo(reg: &mut Registry) {
@@ -173,7 +175,7 @@ fn plugin_deps() {
173175
174176
fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
175177
-> Box<MacResult + 'static> {
176-
MacEager::expr(quote_expr!(cx, 1))
178+
MacEager::expr(cx.expr_lit(sp, LitKind::Int(1, LitIntType::Unsuffixed)))
177179
}
178180
"#)
179181
.build();
@@ -247,7 +249,10 @@ fn plugin_to_the_max() {
247249
use rustc_plugin::Registry;
248250
use syntax::tokenstream::TokenTree;
249251
use syntax::codemap::Span;
252+
use syntax::ast::*;
250253
use syntax::ext::base::{ExtCtxt, MacEager, MacResult};
254+
use syntax::ext::build::AstBuilder;
255+
use syntax::ptr::P;
251256
252257
#[plugin_registrar]
253258
pub fn foo(reg: &mut Registry) {
@@ -256,7 +261,9 @@ fn plugin_to_the_max() {
256261
257262
fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
258263
-> Box<MacResult + 'static> {
259-
MacEager::expr(quote_expr!(cx, baz::baz()))
264+
let bar = Ident::from_str("baz");
265+
let path = cx.path(sp, vec![bar.clone(), bar]);
266+
MacEager::expr(cx.expr_call(sp, cx.expr_path(path), vec![]))
260267
}
261268
"#)
262269
.build();

0 commit comments

Comments
 (0)