diff options
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 2 | ||||
-rw-r--r-- | Cargo.toml | 5 | ||||
-rw-r--r-- | Cargo.toml.orig | 5 | ||||
-rw-r--r-- | METADATA | 6 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | tests/common/eq.rs | 2 | ||||
-rw-r--r-- | tests/test_expr.rs | 70 |
9 files changed, 41 insertions, 55 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 160deecc..649e893c 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "998e86375ba16fe76a89faa13e00a11177965bfd" + "sha1": "4168f6bbdf91a01b24e893c451dd726ecddd88d2" }, "path_in_vcs": "" }
\ No newline at end of file @@ -41,7 +41,7 @@ rust_library_host { name: "libsyn", crate_name: "syn", cargo_env_compat: true, - cargo_pkg_version: "1.0.105", + cargo_pkg_version: "1.0.107", srcs: ["src/lib.rs"], edition: "2018", features: [ @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.31" name = "syn" -version = "1.0.105" +version = "1.0.107" authors = ["David Tolnay <dtolnay@gmail.com>"] include = [ "/benches/**", @@ -56,6 +56,9 @@ features = [ "extra-traits", ] +[lib] +doc-scrape-examples = false + [[bench]] name = "rust" harness = false diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 38a2b888..dd32f92d 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "syn" -version = "1.0.105" # don't forget to update html_root_url and syn.json +version = "1.0.107" # don't forget to update html_root_url and syn.json authors = ["David Tolnay <dtolnay@gmail.com>"] categories = ["development-tools::procedural-macro-helpers", "parser-implementations"] description = "Parser for Rust source code" @@ -54,6 +54,9 @@ tar = "0.4.16" termcolor = "1.0" walkdir = "2.1" +[lib] +doc-scrape-examples = false + [[bench]] name = "rust" harness = false @@ -11,13 +11,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/syn/syn-1.0.105.crate" + value: "https://static.crates.io/crates/syn/syn-1.0.107.crate" } - version: "1.0.105" + version: "1.0.107" license_type: NOTICE last_upgrade_date { year: 2022 month: 12 - day: 7 + day: 22 } } @@ -4,7 +4,7 @@ Parser for Rust source code [<img alt="github" src="https://img.shields.io/badge/github-dtolnay/syn-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/syn) [<img alt="crates.io" src="https://img.shields.io/crates/v/syn.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/syn) [<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-syn-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/syn) -[<img alt="build status" src="https://img.shields.io/github/workflow/status/dtolnay/syn/CI/master?style=for-the-badge" height="20">](https://github.com/dtolnay/syn/actions?query=branch%3Amaster) +[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/dtolnay/syn/ci.yml?branch=master&style=for-the-badge" height="20">](https://github.com/dtolnay/syn/actions?query=branch%3Amaster) Syn is a parsing library for parsing a stream of Rust tokens into a syntax tree of Rust source code. @@ -250,7 +250,7 @@ //! dynamic library libproc_macro from rustc toolchain. // Syn types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/syn/1.0.105")] +#![doc(html_root_url = "https://docs.rs/syn/1.0.107")] #![cfg_attr(doc_cfg, feature(doc_cfg))] #![allow(non_camel_case_types)] #![allow( diff --git a/tests/common/eq.rs b/tests/common/eq.rs index f060e735..41d6d411 100644 --- a/tests/common/eq.rs +++ b/tests/common/eq.rs @@ -518,7 +518,7 @@ spanless_eq_enum!(UintTy; Usize U8 U16 U32 U64 U128); spanless_eq_enum!(UnOp; Deref Not Neg); spanless_eq_enum!(Unsafe; Yes(0) No); spanless_eq_enum!(UnsafeSource; CompilerGenerated UserProvided); -spanless_eq_enum!(UseTreeKind; Simple(0 1 2) Nested(0) Glob); +spanless_eq_enum!(UseTreeKind; Simple(0) Nested(0) Glob); spanless_eq_enum!(VariantData; Struct(0 1) Tuple(0 1) Unit(0)); spanless_eq_enum!(VisibilityKind; Public Restricted(path id shorthand) Inherited); spanless_eq_enum!(WherePredicate; BoundPredicate(0) RegionPredicate(0) EqPredicate(0)); diff --git a/tests/test_expr.rs b/tests/test_expr.rs index 8fd911e2..e5b151fd 100644 --- a/tests/test_expr.rs +++ b/tests/test_expr.rs @@ -53,36 +53,37 @@ fn test_await() { #[rustfmt::skip] #[test] fn test_tuple_multi_index() { + let expected = snapshot!("tuple.0.0" as Expr, @r###" + Expr::Field { + base: Expr::Field { + base: Expr::Path { + path: Path { + segments: [ + PathSegment { + ident: "tuple", + arguments: None, + }, + ], + }, + }, + member: Unnamed(Index { + index: 0, + }), + }, + member: Unnamed(Index { + index: 0, + }), + } + "###); + for &input in &[ - "tuple.0.0", "tuple .0.0", "tuple. 0.0", "tuple.0 .0", "tuple.0. 0", "tuple . 0 . 0", ] { - snapshot!(input as Expr, @r###" - Expr::Field { - base: Expr::Field { - base: Expr::Path { - path: Path { - segments: [ - PathSegment { - ident: "tuple", - arguments: None, - }, - ], - }, - }, - member: Unnamed(Index { - index: 0, - }), - }, - member: Unnamed(Index { - index: 0, - }), - } - "###); + assert_eq!(expected, syn::parse_str(input).unwrap()); } for tokens in vec![ @@ -93,28 +94,7 @@ fn test_tuple_multi_index() { quote!(tuple.0. 0), quote!(tuple . 0 . 0), ] { - snapshot!(tokens as Expr, @r###" - Expr::Field { - base: Expr::Field { - base: Expr::Path { - path: Path { - segments: [ - PathSegment { - ident: "tuple", - arguments: None, - }, - ], - }, - }, - member: Unnamed(Index { - index: 0, - }), - }, - member: Unnamed(Index { - index: 0, - }), - } - "###); + assert_eq!(expected, syn::parse2(tokens).unwrap()); } } |