Skip to content

Commit

Permalink
Update syn to use "use bound"
Browse files Browse the repository at this point in the history
  • Loading branch information
vitdevelop committed Dec 25, 2024
1 parent 76194eb commit 15adba1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions tests/type_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = A> + use<'_> {
match x {
0 => vec![x].into_iter().map(|y| A::First(&y)),
_ => vec![5, 10].into_iter().map(|y| A::Second(y)),
}
}
}

#[test]
Expand Down

0 comments on commit 15adba1

Please sign in to comment.