Skip to content

Commit b65f5a1

Browse files
authored
Rollup merge of #35962 - regexident:compiler-plugin-docs, r=steveklabnik
Updated code sample in chapter on syntax extensions. The affected API apparently had changed with commit d59accf. --- Further more I had to add ```toml [lib] name = "roman_numerals" crate-type = ["dylib"] ``` to `Cargo.toml` as I otherwise got this compiler error (despite `#![crate_type="dylib"]`): [E0457]: plugin `roman_numerals` only found in rlib format, but must be available in dylib format Might be worth adding a note about that?
2 parents 226c6f8 + bf22a7a commit b65f5a1

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)