Update dependencies (#3171)

* Update to syn 2

* bless macro outputs

* update prettyplease

* fix review + update lockfile
This commit is contained in:
Muhammad Hamza 2023-03-28 15:41:55 +05:00 committed by GitHub
parent c5324aff62
commit cc9dd0271e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 438 additions and 467 deletions

193
Cargo.lock generated
View File

@ -22,9 +22,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.69"
version = "1.0.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800"
checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4"
[[package]]
name = "anymap2"
@ -34,13 +34,13 @@ checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c"
[[package]]
name = "async-trait"
version = "0.1.66"
version = "0.1.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc"
checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 2.0.10",
]
[[package]]
@ -336,7 +336,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
]
[[package]]
@ -459,9 +459,9 @@ dependencies = [
[[package]]
name = "cpufeatures"
version = "0.2.5"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320"
checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181"
dependencies = [
"libc",
]
@ -478,9 +478,9 @@ dependencies = [
[[package]]
name = "cxx"
version = "1.0.92"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72"
checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93"
dependencies = [
"cc",
"cxxbridge-flags",
@ -490,9 +490,9 @@ dependencies = [
[[package]]
name = "cxx-build"
version = "1.0.92"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613"
checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b"
dependencies = [
"cc",
"codespan-reporting",
@ -500,24 +500,24 @@ dependencies = [
"proc-macro2",
"quote",
"scratch",
"syn",
"syn 2.0.10",
]
[[package]]
name = "cxxbridge-flags"
version = "1.0.92"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97"
checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb"
[[package]]
name = "cxxbridge-macro"
version = "1.0.92"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56"
checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 2.0.10",
]
[[package]]
@ -541,7 +541,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim",
"syn",
"syn 1.0.109",
]
[[package]]
@ -552,38 +552,38 @@ checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e"
dependencies = [
"darling_core",
"quote",
"syn",
"syn 1.0.109",
]
[[package]]
name = "derive_builder"
version = "0.11.2"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3"
checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8"
dependencies = [
"derive_builder_macro",
]
[[package]]
name = "derive_builder_core"
version = "0.11.2"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4"
checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f"
dependencies = [
"darling",
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
]
[[package]]
name = "derive_builder_macro"
version = "0.11.2"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68"
checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e"
dependencies = [
"derive_builder_core",
"syn",
"syn 1.0.109",
]
[[package]]
@ -596,7 +596,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustc_version",
"syn",
"syn 1.0.109",
]
[[package]]
@ -696,9 +696,9 @@ dependencies = [
[[package]]
name = "fancy-regex"
version = "0.8.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d95b4efe5be9104a4a18a9916e86654319895138be727b229820c39257c30dda"
checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2"
dependencies = [
"bit-set",
"regex",
@ -872,7 +872,7 @@ checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
]
[[package]]
@ -1320,16 +1320,16 @@ dependencies = [
[[package]]
name = "iana-time-zone"
version = "0.1.53"
version = "0.1.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765"
checksum = "0c17cc76786e99f8d2f055c11159e7f0091c42474dcc3189fbab96072e873e6d"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"winapi",
"windows",
]
[[package]]
@ -1379,9 +1379,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "1.9.2"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown",
@ -1422,10 +1422,11 @@ dependencies = [
[[package]]
name = "io-lifetimes"
version = "1.0.6"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3"
checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb"
dependencies = [
"hermit-abi 0.3.1",
"libc",
"windows-sys 0.45.0",
]
@ -1438,9 +1439,9 @@ checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146"
[[package]]
name = "is-terminal"
version = "0.4.4"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857"
checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e"
dependencies = [
"hermit-abi 0.3.1",
"io-lifetimes",
@ -1664,9 +1665,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "mime"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = "mime_guess"
@ -1827,7 +1828,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
]
[[package]]
@ -1851,9 +1852,9 @@ dependencies = [
[[package]]
name = "os_str_bytes"
version = "6.4.1"
version = "6.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267"
[[package]]
name = "papergrid"
@ -1925,7 +1926,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
]
[[package]]
@ -1981,12 +1982,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "prettyplease"
version = "0.1.24"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ebcd279d20a4a0a2404a33056388e950504d891c855c7975b9a8fef75f3bf04"
checksum = "1ceca8aaf45b5c46ec7ed39fff75f57290368c1846d33d24a122ca81416ab058"
dependencies = [
"proc-macro2",
"syn",
"syn 2.0.10",
]
[[package]]
@ -1998,7 +1999,7 @@ dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
"version_check",
]
@ -2015,9 +2016,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.52"
version = "1.0.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224"
checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534"
dependencies = [
"unicode-ident",
]
@ -2121,9 +2122,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.7.1"
version = "1.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"
dependencies = [
"aho-corasick",
"memchr",
@ -2132,15 +2133,15 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.6.28"
version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "reqwest"
version = "0.11.14"
version = "0.11.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9"
checksum = "0ba30cc2c0cd02af1222ed216ba659cdb2f879dfe3181852fe7c50b1d0005949"
dependencies = [
"base64 0.21.0",
"bytes",
@ -2207,9 +2208,9 @@ dependencies = [
[[package]]
name = "rustix"
version = "0.36.9"
version = "0.36.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc"
checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e"
dependencies = [
"bitflags",
"errno",
@ -2304,9 +2305,9 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed"
[[package]]
name = "serde"
version = "1.0.156"
version = "1.0.158"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4"
checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9"
dependencies = [
"serde_derive",
]
@ -2324,13 +2325,13 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.156"
version = "1.0.158"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d"
checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 2.0.10",
]
[[package]]
@ -2475,7 +2476,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
"syn",
"syn 1.0.109",
]
[[package]]
@ -2500,6 +2501,17 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "syn"
version = "2.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aad1363ed6d37b84299588d62d3a7d95b5a5c2d9aad5c85609fda12afaa1f40"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "sync_wrapper"
version = "0.1.2"
@ -2527,7 +2539,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
]
[[package]]
@ -2560,22 +2572,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d"
[[package]]
name = "thiserror"
version = "1.0.39"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c"
checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.39"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e"
checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 2.0.10",
]
[[package]]
@ -2671,7 +2683,7 @@ checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
]
[[package]]
@ -2795,7 +2807,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
]
[[package]]
@ -2815,9 +2827,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
[[package]]
name = "trybuild"
version = "1.0.79"
version = "1.0.80"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db3115bddce1b5f52dd4b5e0ec8298a66ce733e4cc6759247dc2d1c11508ec38"
checksum = "501dbdbb99861e4ab6b60eb6a7493956a9defb644fd034bc4a5ef27c693c8a3a"
dependencies = [
"basic-toml",
"glob",
@ -2881,9 +2893,9 @@ dependencies = [
[[package]]
name = "unicode-bidi"
version = "0.3.11"
version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c"
checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
[[package]]
name = "unicode-ident"
@ -3024,7 +3036,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
"wasm-bindgen-shared",
]
@ -3058,7 +3070,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -3143,7 +3155,7 @@ checksum = "9d9abb8ee84ede5408a346721d72fb216a27f53a539ff3c83ed1bf7625af7104"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.109",
]
[[package]]
@ -3196,6 +3208,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-sys"
version = "0.42.0"
@ -3334,7 +3355,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
"syn",
"syn 2.0.10",
"trybuild",
"yew",
]
@ -3363,7 +3384,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
"syn",
"syn 2.0.10",
"trybuild",
"yew-router",
]
@ -3382,9 +3403,9 @@ dependencies = [
[[package]]
name = "zxcvbn"
version = "2.2.1"
version = "2.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "568becce91e872373a4b33f24ddc67e5280ae2536ccb8c9d22a25d398b72c8b0"
checksum = "103fa851fff70ea29af380e87c25c48ff7faac5c530c70bd0e65366d4e0c94e4"
dependencies = [
"derive_builder",
"fancy-regex",

View File

@ -4,6 +4,9 @@ members = [
"tools/*",
"examples/*",
]
default-members = [
"packages/*",
]
resolver = "2"
[profile.release]

View File

@ -20,9 +20,9 @@ boolinator = "2"
proc-macro-error = "1"
proc-macro2 = "1"
quote = "1"
syn = { version = "1", features = ["full", "extra-traits", "visit-mut"] }
syn = { version = "2", features = ["full", "extra-traits", "visit-mut"] }
once_cell = "1"
prettyplease = "0.1.1"
prettyplease = "0.2"
# testing
[dev-dependencies]

View File

@ -10,7 +10,9 @@ pub struct Classes(Punctuated<ClassExpr, Token![,]>);
impl Parse for Classes {
fn parse(input: ParseStream) -> syn::Result<Self> {
input.parse_terminated(ClassExpr::parse).map(Self)
input
.parse_terminated(ClassExpr::parse, Token![,])
.map(Self)
}
}

View File

@ -201,17 +201,17 @@ impl PropField {
// Detect Properties 2.0 attributes
fn attribute(named_field: &Field) -> Result<PropAttr> {
let attr = named_field.attrs.iter().find(|attr| {
attr.path.is_ident("prop_or")
|| attr.path.is_ident("prop_or_else")
|| attr.path.is_ident("prop_or_default")
attr.path().is_ident("prop_or")
|| attr.path().is_ident("prop_or_else")
|| attr.path().is_ident("prop_or_default")
});
if let Some(attr) = attr {
if attr.path.is_ident("prop_or") {
if attr.path().is_ident("prop_or") {
Ok(PropAttr::PropOr(attr.parse_args()?))
} else if attr.path.is_ident("prop_or_else") {
} else if attr.path().is_ident("prop_or_else") {
Ok(PropAttr::PropOrElse(attr.parse_args()?))
} else if attr.path.is_ident("prop_or_default") {
} else if attr.path().is_ident("prop_or_default") {
Ok(PropAttr::PropOrDefault)
} else {
unreachable!()

View File

@ -30,7 +30,7 @@ fn should_preserve_attr(attr: &Attribute) -> bool {
// sometimes. If not preserved, results in "no-such-field" errors generating
// the field setter for `build` #[allow(...)]: silences warnings from clippy, such as
// dead_code etc. #[deny(...)]: enable additional warnings from clippy
let path = &attr.path;
let path = attr.path();
path.is_ident("allow") || path.is_ident("deny") || path.is_ident("cfg")
}

View File

@ -158,7 +158,7 @@ impl FunctionComponent {
self.attrs
.iter()
.filter_map(|m| {
m.path
m.path()
.get_ident()
.and_then(|ident| match ident.to_string().as_str() {
"doc" | "allow" => Some(m.clone()),
@ -173,7 +173,7 @@ impl FunctionComponent {
self.attrs
.iter()
.filter_map(|m| {
m.path
m.path()
.get_ident()
.and_then(|ident| match ident.to_string().as_str() {
"allow" => Some(m.clone()),

View File

@ -109,7 +109,7 @@ impl TagTokens {
match punct.as_char() {
'/' => {
if angle_count == 1 && input.peek(Token![>]) {
div = Some(syn::token::Div {
div = Some(syn::token::Slash {
spans: [punct.span()],
});
gt = input.parse()?;

View File

@ -4,33 +4,33 @@ use proc_macro2::{Ident, Span, TokenStream};
use quote::{quote, quote_spanned, ToTokens};
use syn::parse::{Parse, ParseStream};
use syn::spanned::Spanned;
use syn::token::Dot2;
use syn::token::DotDot;
use syn::Expr;
use super::{Prop, Props, SpecialProps, CHILDREN_LABEL};
struct BaseExpr {
pub dot2: Dot2,
pub dot_dot: DotDot,
pub expr: Expr,
}
impl Parse for BaseExpr {
fn parse(input: ParseStream) -> syn::Result<Self> {
let dot2 = input.parse()?;
let dot_dot = input.parse()?;
let expr = input.parse().map_err(|expr_error| {
let mut error =
syn::Error::new_spanned(dot2, "expected base props expression after `..`");
syn::Error::new_spanned(dot_dot, "expected base props expression after `..`");
error.combine(expr_error);
error
})?;
Ok(Self { dot2, expr })
Ok(Self { dot_dot, expr })
}
}
impl ToTokens for BaseExpr {
fn to_tokens(&self, tokens: &mut TokenStream) {
let BaseExpr { dot2, expr } = self;
tokens.extend(quote! { #dot2 #expr });
let BaseExpr { dot_dot, expr } = self;
tokens.extend(quote! { #dot_dot #expr });
}
}

View File

@ -6,7 +6,7 @@ use quote::{quote, quote_spanned};
use syn::parse::{Parse, ParseBuffer, ParseStream};
use syn::spanned::Spanned;
use syn::token::Brace;
use syn::{braced, Block, Expr, ExprBlock, ExprPath, ExprRange, Stmt, Token};
use syn::{braced, Block, Expr, ExprBlock, ExprMacro, ExprPath, ExprRange, Stmt, Token};
use crate::html_tree::HtmlDashedName;
use crate::stringify::Stringify;
@ -114,13 +114,13 @@ fn parse_prop_value(input: &ParseBuffer) -> syn::Result<Expr> {
strip_braces(input.parse()?)
} else {
let expr = if let Some(ExprRange {
from: Some(from), ..
start: Some(start), ..
}) = range_expression_peek(input)
{
// If a range expression is seen, treat the left-side expression as the value
// and leave the right-side expression to be parsed as a base expression
advance_until_next_dot2(input)?;
*from
*start
} else {
input.parse()?
};
@ -146,7 +146,11 @@ fn strip_braces(block: ExprBlock) -> syn::Result<Expr> {
} if stmts.len() == 1 => {
let stmt = stmts.remove(0);
match stmt {
Stmt::Expr(expr) => Ok(expr),
Stmt::Expr(expr, None) => Ok(expr),
Stmt::Macro(mac) => Ok(Expr::Macro(ExprMacro {
attrs: vec![],
mac: mac.mac,
})),
// See issue #2267, we want to parse macro invocations as expressions
Stmt::Item(syn::Item::Macro(mac))
if mac.ident.is_none() && mac.semi_token.is_none() =>
@ -156,7 +160,7 @@ fn strip_braces(block: ExprBlock) -> syn::Result<Expr> {
mac: mac.mac,
}))
}
Stmt::Semi(_expr, semi) => Err(syn::Error::new_spanned(
Stmt::Expr(_, Some(semi)) => Err(syn::Error::new_spanned(
semi,
"only an expression may be assigned as a property. Consider removing this \
semicolon",

View File

@ -90,7 +90,7 @@ impl Parse for PropsExpr {
let content;
let brace_token = syn::braced!(content in input);
let fields = content.parse_terminated(PropValue::parse)?;
let fields = content.parse_terminated(PropValue::parse, Token![,])?;
Ok(Self {
ty,
_brace_token: brace_token,

View File

@ -83,6 +83,7 @@ impl Stringify for Lit {
Lit::Int(v) => v.base10_digits().to_string(),
Lit::Float(v) => v.base10_digits().to_string(),
Lit::Bool(_) | Lit::ByteStr(_) | Lit::Byte(_) | Lit::Verbatim(_) => return None,
_ => unreachable!("unknown Lit"),
};
Some(LitStr::new(&s, self.span()))
}

View File

@ -1,4 +1,4 @@
error: expected identifier
error: expected identifier, found keyword `let`
--> tests/function_component_attr/bad-name-fail.rs:8:22
|
8 | #[function_component(let)]

View File

@ -1,5 +1,5 @@
#[allow(dead_code)]
#[rustversion::attr(stable(1.56), test)]
#[rustversion::attr(stable(1.60), test)]
fn tests() {
let t = trybuild::TestCases::new();
t.pass("tests/hook_macro/*-pass.rs");

View File

@ -249,13 +249,11 @@ help: escape `type` to use it as an identifier
85 | html! { <Child r#type=0 /> };
| ++
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Tuple(
ExprTuple {
attrs: [],
paren_token: Paren,
elems: [],
},
)
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Tuple {
attrs: [],
paren_token: Paren,
elems: [],
}
--> tests/html_macro/component-fail.rs:86:24
|
86 | html! { <Child ref=() /> };
@ -321,24 +319,22 @@ error: only one root html element is allowed (hint: you can wrap multiple html e
102 | html! { <Child></Child><Child></Child> };
| ^^^^^^^^^^^^^^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Path(
ExprPath {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "num",
span: #0 bytes(3894..3897),
},
arguments: None,
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Path {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "num",
span: #0 bytes(3894..3897),
},
],
},
arguments: PathArguments::None,
},
],
},
)
}
--> tests/html_macro/component-fail.rs:106:24
|
106 | html! { <Child int=num ..props /> };
@ -380,12 +376,6 @@ error: only an expression may be assigned as a property
147 | html! { <HtmlInProps header={macro_rules! declare { }} /> };
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: only an expression may be assigned as a property. Consider removing this semicolon
--> tests/html_macro/component-fail.rs:148:61
|
148 | html! { <HtmlInProps header={format!("ending with semi");} /> };
| ^
error: mismatched closing tags: expected `A`, found `B`
--> tests/html_macro/component-fail.rs:177:22
|

View File

@ -142,244 +142,107 @@ error: dynamic closing tags must not have a body (hint: replace it with just `</
75 | html! { <@{"test"}></@{"test"}> };
| ^^^^^^^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Tuple(
ExprTuple {
attrs: [],
paren_token: Paren,
elems: [
Lit(
ExprLit {
attrs: [],
lit: Str(
LitStr {
token: "deprecated",
},
),
},
),
Comma,
Lit(
ExprLit {
attrs: [],
lit: Str(
LitStr {
token: "warning",
},
),
},
),
],
},
)
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Tuple {
attrs: [],
paren_token: Paren,
elems: [
Expr::Lit {
attrs: [],
lit: Lit::Str {
token: "deprecated",
},
},
Comma,
Expr::Lit {
attrs: [],
lit: Lit::Str {
token: "warning",
},
},
],
}
--> tests/html_macro/element-fail.rs:83:24
|
83 | html! { <div class=("deprecated", "warning") /> };
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Tuple(
ExprTuple {
attrs: [],
paren_token: Paren,
elems: [],
},
)
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Tuple {
attrs: [],
paren_token: Paren,
elems: [],
}
--> tests/html_macro/element-fail.rs:84:24
|
84 | html! { <input ref=() /> };
| ^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Tuple(
ExprTuple {
attrs: [],
paren_token: Paren,
elems: [],
},
)
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Tuple {
attrs: [],
paren_token: Paren,
elems: [],
}
--> tests/html_macro/element-fail.rs:85:24
|
85 | html! { <input ref=() ref=() /> };
| ^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Call(
ExprCall {
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Call {
attrs: [],
func: Expr::Path {
attrs: [],
func: Path(
ExprPath {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "Some",
span: #0 bytes(2632..2636),
},
arguments: None,
},
],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "Some",
span: #0 bytes(2632..2636),
},
arguments: PathArguments::None,
},
},
),
paren_token: Paren,
args: [
Lit(
ExprLit {
attrs: [],
lit: Int(
LitInt {
token: 5,
},
),
},
),
],
],
},
},
)
paren_token: Paren,
args: [
Expr::Lit {
attrs: [],
lit: Lit::Int {
token: 5,
},
},
],
}
--> tests/html_macro/element-fail.rs:86:28
|
86 | html! { <input onfocus=Some(5) /> };
| ^^^^^^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Path(
ExprPath {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "NotToString",
span: #0 bytes(2672..2683),
},
arguments: None,
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Path {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "NotToString",
span: #0 bytes(2672..2683),
},
],
},
arguments: PathArguments::None,
},
],
},
)
}
--> tests/html_macro/element-fail.rs:87:27
|
87 | html! { <input string=NotToString /> };
| ^^^^^^^^^^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Call(
ExprCall {
attrs: [],
func: Path(
ExprPath {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "Some",
span: #0 bytes(2711..2715),
},
arguments: None,
},
],
},
},
),
paren_token: Paren,
args: [
Path(
ExprPath {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "NotToString",
span: #0 bytes(2716..2727),
},
arguments: None,
},
],
},
},
),
],
},
)
--> tests/html_macro/element-fail.rs:88:22
|
88 | html! { <a media=Some(NotToString) /> };
| ^^^^^^^^^^^^^^^^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Call(
ExprCall {
attrs: [],
func: Path(
ExprPath {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "Some",
span: #0 bytes(2755..2759),
},
arguments: None,
},
],
},
},
),
paren_token: Paren,
args: [
Lit(
ExprLit {
attrs: [],
lit: Int(
LitInt {
token: 5,
},
),
},
),
],
},
)
--> tests/html_macro/element-fail.rs:89:21
|
89 | html! { <a href=Some(5) /> };
| ^^^^^^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Tuple(
ExprTuple {
attrs: [],
paren_token: Paren,
elems: [],
},
)
--> tests/html_macro/element-fail.rs:90:25
|
90 | html! { <input type=() /> };
| ^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Tuple(
ExprTuple {
attrs: [],
paren_token: Paren,
elems: [],
},
)
--> tests/html_macro/element-fail.rs:91:26
|
91 | html! { <input value=() /> };
| ^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Path(
ExprPath {
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Call {
attrs: [],
func: Expr::Path {
attrs: [],
qself: None,
path: Path {
@ -387,15 +250,108 @@ error: the property value must be either a literal or enclosed in braces. Consid
segments: [
PathSegment {
ident: Ident {
ident: "NotToString",
span: #0 bytes(2862..2873),
ident: "Some",
span: #0 bytes(2711..2715),
},
arguments: None,
arguments: PathArguments::None,
},
],
},
},
)
paren_token: Paren,
args: [
Expr::Path {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "NotToString",
span: #0 bytes(2716..2727),
},
arguments: PathArguments::None,
},
],
},
},
],
}
--> tests/html_macro/element-fail.rs:88:22
|
88 | html! { <a media=Some(NotToString) /> };
| ^^^^^^^^^^^^^^^^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Call {
attrs: [],
func: Expr::Path {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "Some",
span: #0 bytes(2755..2759),
},
arguments: PathArguments::None,
},
],
},
},
paren_token: Paren,
args: [
Expr::Lit {
attrs: [],
lit: Lit::Int {
token: 5,
},
},
],
}
--> tests/html_macro/element-fail.rs:89:21
|
89 | html! { <a href=Some(5) /> };
| ^^^^^^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Tuple {
attrs: [],
paren_token: Paren,
elems: [],
}
--> tests/html_macro/element-fail.rs:90:25
|
90 | html! { <input type=() /> };
| ^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Tuple {
attrs: [],
paren_token: Paren,
elems: [],
}
--> tests/html_macro/element-fail.rs:91:26
|
91 | html! { <input value=() /> };
| ^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::Path {
attrs: [],
qself: None,
path: Path {
leading_colon: None,
segments: [
PathSegment {
ident: Ident {
ident: "NotToString",
span: #0 bytes(2862..2873),
},
arguments: PathArguments::None,
},
],
},
}
--> tests/html_macro/element-fail.rs:92:27
|
92 | html! { <input string=NotToString /> };
@ -483,7 +439,7 @@ error[E0277]: the trait bound `Option<NotToString>: IntoPropValue<Option<implici
<Option<&'static str> as IntoPropValue<Option<VNode>>>
<Option<&'static str> as IntoPropValue<Option<implicit_clone::unsync::IString>>>
<Option<F> as IntoPropValue<Option<yew::Callback<I, O>>>>
and 7 others
and $N others
error[E0277]: the trait bound `Option<{integer}>: IntoPropValue<Option<implicit_clone::unsync::IString>>` is not satisfied
--> tests/html_macro/element-fail.rs:48:22
@ -499,80 +455,80 @@ error[E0277]: the trait bound `Option<{integer}>: IntoPropValue<Option<implicit_
<Option<&'static str> as IntoPropValue<Option<VNode>>>
<Option<&'static str> as IntoPropValue<Option<implicit_clone::unsync::IString>>>
<Option<F> as IntoPropValue<Option<yew::Callback<I, O>>>>
and 7 others
and $N others
error[E0277]: expected a `Fn<(MouseEvent,)>` closure, found `{integer}`
--> tests/html_macro/element-fail.rs:51:28
|
51 | html! { <input onclick=1 /> };
| -----------------------^-----
| | |
| | expected an `Fn<(MouseEvent,)>` closure, found `{integer}`
| required by a bound introduced by this call
|
= help: the trait `Fn<(MouseEvent,)>` is not implemented for `{integer}`
= note: required because of the requirements on the impl of `IntoEventCallback<MouseEvent>` for `{integer}`
--> tests/html_macro/element-fail.rs:51:28
|
51 | html! { <input onclick=1 /> };
| -----------------------^-----
| | |
| | expected an `Fn<(MouseEvent,)>` closure, found `{integer}`
| required by a bound introduced by this call
|
= help: the trait `Fn<(MouseEvent,)>` is not implemented for `{integer}`
= note: required because of the requirements on the impl of `IntoEventCallback<MouseEvent>` for `{integer}`
note: required by a bound in `yew::html::onclick::Wrapper::__macro_new`
--> $WORKSPACE/packages/yew/src/html/listener/events.rs
|
| / impl_short! {
| | onauxclick(MouseEvent)
| | onclick(MouseEvent)
| |
... |
| | ontransitionstart(TransitionEvent)
| | }
| |_^ required by this bound in `yew::html::onclick::Wrapper::__macro_new`
= note: this error originates in the macro `impl_action` (in Nightly builds, run with -Z macro-backtrace for more info)
--> $WORKSPACE/packages/yew/src/html/listener/events.rs
|
| / impl_short! {
| | onauxclick(MouseEvent)
| | onclick(MouseEvent)
| |
... |
| | ontransitionstart(TransitionEvent)
| | }
| |_^ required by this bound in `yew::html::onclick::Wrapper::__macro_new`
= note: this error originates in the macro `impl_action` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: expected a `Fn<(MouseEvent,)>` closure, found `yew::Callback<String>`
--> tests/html_macro/element-fail.rs:52:29
|
52 | html! { <input onclick={Callback::from(|a: String| ())} /> };
| ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------
| | |
| | expected an `Fn<(MouseEvent,)>` closure, found `yew::Callback<String>`
| required by a bound introduced by this call
|
= help: the trait `Fn<(MouseEvent,)>` is not implemented for `yew::Callback<String>`
= note: required because of the requirements on the impl of `IntoEventCallback<MouseEvent>` for `yew::Callback<String>`
--> tests/html_macro/element-fail.rs:52:29
|
52 | html! { <input onclick={Callback::from(|a: String| ())} /> };
| ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------
| | |
| | expected an `Fn<(MouseEvent,)>` closure, found `yew::Callback<String>`
| required by a bound introduced by this call
|
= help: the trait `Fn<(MouseEvent,)>` is not implemented for `yew::Callback<String>`
= note: required because of the requirements on the impl of `IntoEventCallback<MouseEvent>` for `yew::Callback<String>`
note: required by a bound in `yew::html::onclick::Wrapper::__macro_new`
--> $WORKSPACE/packages/yew/src/html/listener/events.rs
|
| / impl_short! {
| | onauxclick(MouseEvent)
| | onclick(MouseEvent)
| |
... |
| | ontransitionstart(TransitionEvent)
| | }
| |_^ required by this bound in `yew::html::onclick::Wrapper::__macro_new`
= note: this error originates in the macro `impl_action` (in Nightly builds, run with -Z macro-backtrace for more info)
--> $WORKSPACE/packages/yew/src/html/listener/events.rs
|
| / impl_short! {
| | onauxclick(MouseEvent)
| | onclick(MouseEvent)
| |
... |
| | ontransitionstart(TransitionEvent)
| | }
| |_^ required by this bound in `yew::html::onclick::Wrapper::__macro_new`
= note: this error originates in the macro `impl_action` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Option<{integer}>: IntoEventCallback<FocusEvent>` is not satisfied
--> tests/html_macro/element-fail.rs:53:29
|
53 | html! { <input onfocus={Some(5)} /> };
| ------------------------^^^^^^^------
| | |
| | the trait `IntoEventCallback<FocusEvent>` is not implemented for `Option<{integer}>`
| required by a bound introduced by this call
|
= help: the following implementations were found:
<Option<T> as IntoEventCallback<EVENT>>
<Option<yew::Callback<EVENT>> as IntoEventCallback<EVENT>>
--> tests/html_macro/element-fail.rs:53:29
|
53 | html! { <input onfocus={Some(5)} /> };
| ------------------------^^^^^^^------
| | |
| | the trait `IntoEventCallback<FocusEvent>` is not implemented for `Option<{integer}>`
| required by a bound introduced by this call
|
= help: the following implementations were found:
<Option<T> as IntoEventCallback<EVENT>>
<Option<yew::Callback<EVENT>> as IntoEventCallback<EVENT>>
note: required by a bound in `yew::html::onfocus::Wrapper::__macro_new`
--> $WORKSPACE/packages/yew/src/html/listener/events.rs
|
| / impl_short! {
| | onauxclick(MouseEvent)
| | onclick(MouseEvent)
| |
... |
| | ontransitionstart(TransitionEvent)
| | }
| |_^ required by this bound in `yew::html::onfocus::Wrapper::__macro_new`
= note: this error originates in the macro `impl_action` (in Nightly builds, run with -Z macro-backtrace for more info)
--> $WORKSPACE/packages/yew/src/html/listener/events.rs
|
| / impl_short! {
| | onauxclick(MouseEvent)
| | onclick(MouseEvent)
| |
... |
| | ontransitionstart(TransitionEvent)
| | }
| |_^ required by this bound in `yew::html::onfocus::Wrapper::__macro_new`
= note: this error originates in the macro `impl_action` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `(): IntoPropValue<yew::NodeRef>` is not satisfied
--> tests/html_macro/element-fail.rs:56:25
@ -597,31 +553,31 @@ error[E0277]: the trait bound `Option<yew::NodeRef>: IntoPropValue<yew::NodeRef>
<Option<&'static str> as IntoPropValue<Option<VNode>>>
<Option<&'static str> as IntoPropValue<Option<implicit_clone::unsync::IString>>>
<Option<F> as IntoPropValue<Option<yew::Callback<I, O>>>>
and 7 others
and $N others
error[E0277]: expected a `Fn<(MouseEvent,)>` closure, found `yew::Callback<String>`
--> tests/html_macro/element-fail.rs:58:29
|
58 | html! { <input onclick={Callback::from(|a: String| ())} /> };
| ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------
| | |
| | expected an `Fn<(MouseEvent,)>` closure, found `yew::Callback<String>`
| required by a bound introduced by this call
|
= help: the trait `Fn<(MouseEvent,)>` is not implemented for `yew::Callback<String>`
= note: required because of the requirements on the impl of `IntoEventCallback<MouseEvent>` for `yew::Callback<String>`
--> tests/html_macro/element-fail.rs:58:29
|
58 | html! { <input onclick={Callback::from(|a: String| ())} /> };
| ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------
| | |
| | expected an `Fn<(MouseEvent,)>` closure, found `yew::Callback<String>`
| required by a bound introduced by this call
|
= help: the trait `Fn<(MouseEvent,)>` is not implemented for `yew::Callback<String>`
= note: required because of the requirements on the impl of `IntoEventCallback<MouseEvent>` for `yew::Callback<String>`
note: required by a bound in `yew::html::onclick::Wrapper::__macro_new`
--> $WORKSPACE/packages/yew/src/html/listener/events.rs
|
| / impl_short! {
| | onauxclick(MouseEvent)
| | onclick(MouseEvent)
| |
... |
| | ontransitionstart(TransitionEvent)
| | }
| |_^ required by this bound in `yew::html::onclick::Wrapper::__macro_new`
= note: this error originates in the macro `impl_action` (in Nightly builds, run with -Z macro-backtrace for more info)
--> $WORKSPACE/packages/yew/src/html/listener/events.rs
|
| / impl_short! {
| | onauxclick(MouseEvent)
| | onclick(MouseEvent)
| |
... |
| | ontransitionstart(TransitionEvent)
| | }
| |_^ required by this bound in `yew::html::onclick::Wrapper::__macro_new`
= note: this error originates in the macro `impl_action` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `NotToString: IntoPropValue<Option<implicit_clone::unsync::IString>>` is not satisfied
--> tests/html_macro/element-fail.rs:60:28
@ -652,5 +608,5 @@ error[E0277]: the trait bound `Cow<'static, str>: From<{integer}>` is not satisf
<Cow<'a, CStr> as From<&'a CString>>
<Cow<'a, CStr> as From<CString>>
<Cow<'a, OsStr> as From<&'a OsStr>>
and 11 others
and $N others
= note: required because of the requirements on the impl of `Into<Cow<'static, str>>` for `{integer}`

View File

@ -46,29 +46,23 @@ error: expected an expression following this equals sign
18 | html! { <key=></> };
| ^^
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: MethodCall(
ExprMethodCall {
error: the property value must be either a literal or enclosed in braces. Consider adding braces around your expression.: Expr::MethodCall {
attrs: [],
receiver: Expr::Lit {
attrs: [],
receiver: Lit(
ExprLit {
attrs: [],
lit: Str(
LitStr {
token: "key",
},
),
},
),
dot_token: Dot,
method: Ident {
ident: "to_string",
span: #0 bytes(404..413),
lit: Lit::Str {
token: "key",
},
turbofish: None,
paren_token: Paren,
args: [],
},
)
dot_token: Dot,
method: Ident {
ident: "to_string",
span: #0 bytes(404..413),
},
turbofish: None,
paren_token: Paren,
args: [],
}
--> tests/html_macro/list-fail.rs:20:18
|
20 | html! { <key="key".to_string()></key> };

View File

@ -14,7 +14,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1"
quote = "1"
syn = { version = "1", features = ["full","extra-traits"] }
syn = { version = "2", features = ["full","extra-traits"] }
[dev-dependencies]
rustversion = "1"

View File

@ -65,7 +65,7 @@ fn parse_variants_attributes(
let attrs = &variant.attrs;
let at_attrs = attrs
.iter()
.filter(|attr| attr.path.is_ident(AT_ATTR_IDENT))
.filter(|attr| attr.path().is_ident(AT_ATTR_IDENT))
.collect::<Vec<_>>();
let attr = match at_attrs.len() {
@ -104,7 +104,7 @@ fn parse_variants_attributes(
ats.push(lit);
for attr in attrs.iter() {
if attr.path.is_ident(NOT_FOUND_ATTR_IDENT) {
if attr.path().is_ident(NOT_FOUND_ATTR_IDENT) {
not_found_attrs.push(attr);
not_founds.push(variant.ident.clone())
}