Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #39 from taiki-e/proc-macro-next
Browse files Browse the repository at this point in the history
Update proc-macro2, syn, and quote to 1.0
  • Loading branch information
dtolnay committed Aug 13, 2019
2 parents f02410c + a2a3640 commit 5a860a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ matrix:
name: Minimal versions
before_script:
- cargo update -Z minimal-versions --manifest-path example/Cargo.toml
- rust: 1.30.0
- rust: 1.31.0
name: 2015 edition
script:
- cargo check
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ readme = "README.md"
proc-macro = true

[dependencies]
proc-macro2 = "0.4.19"
quote = "0.6.8"
syn = "0.15.14"
proc-macro2 = "1.0.0"
quote = "1.0.0"
syn = "1.0.0"

[dev-dependencies]
demo-hack = { version = "0.0.5", path = "demo-hack" }
Expand Down
4 changes: 2 additions & 2 deletions demo-hack-impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ proc-macro = true

[dependencies]
proc-macro-hack = { version = "0.5", path = ".." }
quote = "0.6"
syn = { version = "0.15", features = ["full"] }
quote = "1.0"
syn = { version = "1.0", features = ["full"] }
11 changes: 4 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ extern crate syn;
use std::fmt::Write;

use proc_macro2::{Span, TokenStream, TokenTree};
use quote::{quote, ToTokens};
use quote::{format_ident, quote, ToTokens};
use syn::parse::{Parse, ParseStream, Result};
use syn::{braced, bracketed, parenthesized, parse_macro_input, token, Ident, Token};

Expand Down Expand Up @@ -603,18 +603,15 @@ fn expand_define(define: Define) -> TokenStream {
}

fn actual_proc_macro_name(conceptual: &Ident) -> Ident {
let actual_name = format!("proc_macro_hack_{}", conceptual);
Ident::new(&actual_name, Span::call_site())
format_ident!("proc_macro_hack_{}", conceptual)
}

fn dispatch_macro_name(conceptual: &Ident) -> Ident {
let dispatch = format!("proc_macro_call_{}", conceptual);
Ident::new(&dispatch, Span::call_site())
format_ident!("proc_macro_call_{}", conceptual)
}

fn call_site_macro_name(conceptual: &Ident) -> Ident {
let dispatch = format!("proc_macro_fake_call_site_{}", conceptual);
Ident::new(&dispatch, Span::call_site())
format_ident!("proc_macro_fake_call_site_{}", conceptual)
}

fn dummy_name_for_export(export: &Export) -> String {
Expand Down

0 comments on commit 5a860a7

Please sign in to comment.