Skip to content

Commit bf22a7a

Browse files
committed
Updated code sample in chapter on syntax extensions.
The affected API apparently had changed with commit d59accf.
1 parent 308824a commit bf22a7a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/book/compiler-plugins.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ extern crate rustc;
4646
extern crate rustc_plugin;
4747
4848
use syntax::parse::token;
49-
use syntax::ast::TokenTree;
49+
use syntax::tokenstream::TokenTree;
5050
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
5151
use syntax::ext::build::AstBuilder; // trait for expr_usize
52-
use syntax_pos::Span;
52+
use syntax::ext::quote::rt::Span;
5353
use rustc_plugin::Registry;
5454
5555
fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
@@ -69,7 +69,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
6969
}
7070
7171
let text = match args[0] {
72-
TokenTree::Token(_, token::Ident(s, _)) => s.to_string(),
72+
TokenTree::Token(_, token::Ident(s)) => s.to_string(),
7373
_ => {
7474
cx.span_err(sp, "argument should be a single identifier");
7575
return DummyResult::any(sp);

0 commit comments

Comments
 (0)