From 15adba1f6c01e9019e8b70b9727c06b9491af235 Mon Sep 17 00:00:00 2001 From: vitdevelop Date: Wed, 25 Dec 2024 17:36:11 +0200 Subject: [PATCH] Update syn to use "use bound" --- Cargo.toml | 4 ++-- tests/type_analysis.rs | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8527e16a..c7fb01b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "auto_enums" version = "0.8.6" #publish:version edition = "2021" -rust-version = "1.56" +rust-version = "1.61" license = "Apache-2.0 OR MIT" repository = "https://github.com/taiki-e/auto_enums" keywords = ["enum", "macros", "derive", "attribute"] @@ -84,7 +84,7 @@ trusted_len = [] derive_utils = "0.14.1" proc-macro2 = "1.0.60" quote = "1.0.25" -syn = { version = "2.0.1", default-features = false, features = ["parsing", "printing", "clone-impls", "proc-macro", "full", "visit-mut"] } +syn = { version = "2.0.91", default-features = false, features = ["parsing", "printing", "clone-impls", "proc-macro", "full", "visit-mut"] } [dev-dependencies] macrotest = { git = "https://github.com/taiki-e/macrotest.git", branch = "dev" } # adjust overwrite behavior + no cargo-expand diff --git a/tests/type_analysis.rs b/tests/type_analysis.rs index f2958e3c..5d0b95e6 100644 --- a/tests/type_analysis.rs +++ b/tests/type_analysis.rs @@ -68,6 +68,18 @@ fn func() { x -= 1; } } + + enum A<'a>{ + First(&'a i32), + Second(i32), + } + #[auto_enum] + fn use_bound(x: &i32) -> impl Iterator + use<'_> { + match x { + 0 => vec![x].into_iter().map(|y| A::First(&y)), + _ => vec![5, 10].into_iter().map(|y| A::Second(y)), + } + } } #[test]