]> git.lizzy.rs Git - rust.git/commitdiff
Updated code sample in chapter on syntax extensions.
authorVincent Esche <regexident@gmail.com>
Wed, 24 Aug 2016 13:43:28 +0000 (15:43 +0200)
committerVincent Esche <regexident@gmail.com>
Wed, 24 Aug 2016 13:43:28 +0000 (15:43 +0200)
The affected API apparently had changed with commit d59accfb065843d12db9180a4f504664e3d23ef1.

src/doc/book/compiler-plugins.md

index 8426d5a626549b8ea22b33f3598a78090491e63f..a9a81843ab199c471e3d2c2b56b7408c1d6b5b55 100644 (file)
@@ -46,10 +46,10 @@ extern crate rustc;
 extern crate rustc_plugin;
 
 use syntax::parse::token;
-use syntax::ast::TokenTree;
+use syntax::tokenstream::TokenTree;
 use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
 use syntax::ext::build::AstBuilder;  // trait for expr_usize
-use syntax_pos::Span;
+use syntax::ext::quote::rt::Span;
 use rustc_plugin::Registry;
 
 fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
@@ -69,7 +69,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
     }
 
     let text = match args[0] {
-        TokenTree::Token(_, token::Ident(s, _)) => s.to_string(),
+        TokenTree::Token(_, token::Ident(s)) => s.to_string(),
         _ => {
             cx.span_err(sp, "argument should be a single identifier");
             return DummyResult::any(sp);