Skip to content

Commit 8b457c2

Browse files
committed
Upgrade to proc-macro2 0.2
1 parent 3569255 commit 8b457c2

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ include = ["Cargo.toml", "src/**/*.rs", "tests/**/*.rs", "README.md", "LICENSE-A
1111
publish = false # this branch contains breaking changes
1212

1313
[dependencies]
14-
proc-macro2 = "0.1"
14+
proc-macro2 = "0.2"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Any interpolated tokens preserve the `Span` information provided by their
104104
`ToTokens` implementation. Tokens that originate within a `quote!` invocation
105105
are spanned with [`Span::def_site()`].
106106

107-
[`Span::def_site()`]: https://docs.rs/proc-macro2/0.1/proc_macro2/struct.Span.html#method.def_site
107+
[`Span::def_site()`]: https://docs.rs/proc-macro2/0.2/proc_macro2/struct.Span.html#method.def_site
108108

109109
A different span can be provided explicitly through the [`quote_spanned!`]
110110
macro.

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub mod __rt {
160160
/// `ToTokens` implementation. Tokens that originate within the `quote!`
161161
/// invocation are spanned with [`Span::def_site()`].
162162
///
163-
/// [`Span::def_site()`]: https://docs.rs/proc-macro2/0.1/proc_macro2/struct.Span.html#method.def_site
163+
/// [`Span::def_site()`]: https://docs.rs/proc-macro2/0.2/proc_macro2/struct.Span.html#method.def_site
164164
///
165165
/// A different span can be provided through the [`quote_spanned!`] macro.
166166
///
@@ -218,7 +218,7 @@ macro_rules! quote {
218218
/// to quote. The span expression should be brief -- use a variable for anything
219219
/// more than a few characters. There should be no space before the `=>` token.
220220
///
221-
/// [`Span`]: https://docs.rs/proc-macro2/0.1/proc_macro2/struct.Span.html
221+
/// [`Span`]: https://docs.rs/proc-macro2/0.2/proc_macro2/struct.Span.html
222222
///
223223
/// ```
224224
/// # #[macro_use]

src/to_tokens.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use proc_macro2::{Literal, Span, Term, TokenNode, TokenTree, TokenStream};
66

77
fn tt(kind: TokenNode) -> TokenTree {
88
TokenTree {
9-
span: Span::default(),
9+
span: Span::def_site(),
1010
kind: kind,
1111
}
1212
}

tests/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ extern crate proc_macro2;
66
#[macro_use]
77
extern crate quote;
88

9-
use proc_macro2::Term;
9+
use proc_macro2::{Span, Term};
1010

1111
struct X;
1212

1313
impl quote::ToTokens for X {
1414
fn to_tokens(&self, tokens: &mut quote::Tokens) {
1515
tokens.append(proc_macro2::TokenTree {
1616
kind: proc_macro2::TokenNode::Term(Term::intern("X")),
17-
span: Default::default(),
17+
span: Span::def_site(),
1818
});
1919
}
2020
}

0 commit comments

Comments
 (0)