Skip to content

Commit

Permalink
Merge pull request #417 from serde-rs/bump
Browse files Browse the repository at this point in the history
Update syntex to 0.37
  • Loading branch information
dtolnay authored Jul 3, 2016
2 parents 47c7387 + d450de1 commit 5deba43
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 42 deletions.
6 changes: 3 additions & 3 deletions examples/serde-syntex-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ default = ["serde_codegen"]
nightly = ["serde_macros"]

[build-dependencies]
serde_codegen = { version = "^0.7.11", optional = true }
serde_codegen = { version = "^0.7.12", optional = true }

[dependencies]
serde = "^0.7.11"
serde = "^0.7.12"
serde_json = "^0.7.0"
serde_macros = { version = "^0.7.11", optional = true }
serde_macros = { version = "^0.7.12", optional = true }
2 changes: 1 addition & 1 deletion serde/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde"
version = "0.7.11"
version = "0.7.12"
authors = ["Erick Tryzelaar <[email protected]>"]
license = "MIT/Apache-2.0"
description = "A generic serialization/deserialization framework"
Expand Down
18 changes: 9 additions & 9 deletions serde_codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde_codegen"
version = "0.7.11"
version = "0.7.12"
authors = ["Erick Tryzelaar <[email protected]>"]
license = "MIT/Apache-2.0"
description = "Macros to auto-generate implementations for the serde framework"
Expand All @@ -24,14 +24,14 @@ with-syntex = [
]

[build-dependencies]
quasi_codegen = { version = "^0.13.0", optional = true }
syntex = { version = "^0.36.0", optional = true }
quasi_codegen = { version = "^0.14.0", optional = true }
syntex = { version = "^0.37.0", optional = true }

[dependencies]
aster = { version = "^0.19.0", default-features = false }
aster = { version = "^0.20.0", default-features = false }
clippy = { version = "^0.*", optional = true }
quasi = { version = "^0.13.0", default-features = false }
quasi_macros = { version = "^0.13.0", optional = true }
serde_codegen_internals = { version = "^0.1.0", path = "../serde_codegen_internals", default-features = false }
syntex = { version = "^0.36.0", optional = true }
syntex_syntax = { version = "^0.36.0", optional = true }
quasi = { version = "^0.14.0", default-features = false }
quasi_macros = { version = "^0.14.0", optional = true }
serde_codegen_internals = { version = "^0.2.0", path = "../serde_codegen_internals", default-features = false }
syntex = { version = "^0.37.0", optional = true }
syntex_syntax = { version = "^0.37.0", optional = true }
4 changes: 2 additions & 2 deletions serde_codegen/src/bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ fn contains_recursion(ty: &ast::Ty, ident: ast::Ident) -> bool {
ident: ast::Ident,
found_recursion: bool,
}
impl<'v> visit::Visitor<'v> for FindRecursion {
fn visit_path(&mut self, path: &'v ast::Path, _id: ast::NodeId) {
impl visit::Visitor for FindRecursion {
fn visit_path(&mut self, path: &ast::Path, _id: ast::NodeId) {
if !path.global
&& path.segments.len() == 1
&& path.segments[0].identifier == self.ident {
Expand Down
3 changes: 2 additions & 1 deletion serde_codegen/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use syntax::codemap::Span;
use syntax::ext::base::{Annotatable, ExtCtxt};
use syntax::parse::token::InternedString;
use syntax::ptr::P;
use syntax::tokenstream::TokenTree;

use bound;
use internals::ast::{Body, Field, Item, Style, Variant};
Expand Down Expand Up @@ -471,7 +472,7 @@ fn deserialize_newtype_struct(
type_path: &ast::Path,
impl_generics: &ast::Generics,
field: &Field,
) -> Vec<ast::TokenTree> {
) -> Vec<TokenTree> {
let value = match field.attrs.deserialize_with() {
None => {
let field_ty = &field.ty;
Expand Down
7 changes: 4 additions & 3 deletions serde_codegen_internals/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde_codegen_internals"
version = "0.1.0"
version = "0.2.0"
authors = ["Erick Tryzelaar <[email protected]>"]
license = "MIT/Apache-2.0"
description = "AST representation used by Serde codegen. Unstable."
Expand All @@ -12,8 +12,9 @@ include = ["Cargo.toml", "src/**/*.rs"]
[features]
default = ["with-syntex"]
nightly-testing = ["clippy"]
with-syntex = ["syntex_syntax"]
with-syntex = ["syntex_syntax", "syntex_errors"]

[dependencies]
clippy = { version = "^0.*", optional = true }
syntex_syntax = { version = "^0.36.0", optional = true }
syntex_syntax = { version = "^0.37.0", optional = true }
syntex_errors = { version = "^0.37.0", optional = true }
31 changes: 15 additions & 16 deletions serde_codegen_internals/src/attr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use std::rc::Rc;

use syntax::ast::{self, TokenTree};
use syntax::attr;
use syntax::ast;
use syntax::attr::{self, HasAttrs};
use syntax::codemap::{Span, Spanned, respan};
use syntax::ext::base::ExtCtxt;
use syntax::fold::Folder;
Expand All @@ -10,6 +8,7 @@ use syntax::parse::token::{self, InternedString};
use syntax::parse;
use syntax::print::pprust::{lit_to_string, meta_item_to_string};
use syntax::ptr::P;
use syntax::tokenstream::{self, TokenTree};

// This module handles parsing of `#[serde(...)]` attributes. The entrypoints
// are `attr::Item::from_ast`, `attr::Variant::from_ast`, and
Expand Down Expand Up @@ -518,33 +517,33 @@ struct Respanner<'a, 'b: 'a> {
}

impl<'a, 'b> Folder for Respanner<'a, 'b> {
fn fold_tt(&mut self, tt: &TokenTree) -> TokenTree {
match *tt {
fn fold_tt(&mut self, tt: TokenTree) -> TokenTree {
match tt {
TokenTree::Token(span, ref tok) => {
TokenTree::Token(
self.new_span(span),
self.fold_token(tok.clone())
)
}
TokenTree::Delimited(span, ref delimed) => {
TokenTree::Delimited(span, delimed) => {
TokenTree::Delimited(
self.new_span(span),
Rc::new(ast::Delimited {
tokenstream::Delimited {
delim: delimed.delim,
open_span: delimed.open_span,
tts: self.fold_tts(&delimed.tts),
tts: self.fold_tts(delimed.tts),
close_span: delimed.close_span,
})
}
)
}
TokenTree::Sequence(span, ref seq) => {
TokenTree::Sequence(span, seq) => {
TokenTree::Sequence(
self.new_span(span),
Rc::new(ast::SequenceRepetition {
tts: self.fold_tts(&seq.tts),
tokenstream::SequenceRepetition {
tts: self.fold_tts(seq.tts),
separator: seq.separator.clone().map(|tok| self.fold_token(tok)),
..**seq
})
..seq
}
)
}
}
Expand Down Expand Up @@ -590,7 +589,7 @@ fn parse_string_via_tts<T, F>(cx: &ExtCtxt, name: &str, string: String, action:
cx.parse_sess()));

// Respan the spans to say they are all coming from this macro.
let tts = Respanner { cx: cx }.fold_tts(&tts);
let tts = Respanner { cx: cx }.fold_tts(tts);

let mut parser = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), tts);

Expand Down
4 changes: 4 additions & 0 deletions serde_codegen_internals/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
#[cfg(feature = "with-syntex")]
#[macro_use]
extern crate syntex_syntax as syntax;
#[cfg(feature = "with-syntex")]
extern crate syntex_errors as errors;

#[cfg(not(feature = "with-syntex"))]
#[macro_use]
extern crate syntax;
#[cfg(not(feature = "with-syntex"))]
extern crate rustc_errors as errors;

pub mod ast;
pub mod attr;
Expand Down
8 changes: 4 additions & 4 deletions serde_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde_macros"
version = "0.7.11"
version = "0.7.12"
authors = ["Erick Tryzelaar <[email protected]>"]
license = "MIT/Apache-2.0"
description = "Macros to auto-generate implementations for the serde framework"
Expand All @@ -18,14 +18,14 @@ nightly-testing = ["clippy", "serde/nightly-testing", "serde_codegen/nightly-tes

[dependencies]
clippy = { version = "^0.*", optional = true }
serde_codegen = { version = "^0.7.11", path = "../serde_codegen", default-features = false, features = ["nightly"] }
serde_codegen = { version = "^0.7.12", path = "../serde_codegen", default-features = false, features = ["nightly"] }

[dev-dependencies]
compiletest_rs = "^0.2.0"
fnv = "1.0"
rustc-serialize = "^0.3.16"
serde = { version = "^0.7.11", path = "../serde" }
serde_test = { version = "^0.7.11", path = "../serde_test" }
serde = { version = "^0.7.12", path = "../serde" }
serde_test = { version = "^0.7.12", path = "../serde_test" }

[[test]]
name = "test"
Expand Down
4 changes: 2 additions & 2 deletions serde_test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde_test"
version = "0.7.11"
version = "0.7.12"
authors = ["Erick Tryzelaar <[email protected]>"]
license = "MIT/Apache-2.0"
description = "Token De/Serializer for testing De/Serialize implementations"
Expand All @@ -11,4 +11,4 @@ keywords = ["serde", "serialization"]
include = ["Cargo.toml", "src/**/*.rs"]

[dependencies]
serde = { version = "0.7.11", path = "../serde" }
serde = { version = "0.7.12", path = "../serde" }
2 changes: 1 addition & 1 deletion testing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde_testing"
version = "0.7.11"
version = "0.7.12"
authors = ["Erick Tryzelaar <[email protected]>"]
license = "MIT/Apache-2.0"
description = "A generic serialization/deserialization framework"
Expand Down

0 comments on commit 5deba43

Please sign in to comment.