Skip to content

Commit

Permalink
Upgrade syn crate to 2.0.45 version (#341, #301)
Browse files Browse the repository at this point in the history
Upgrade minimal version of `syn` up to 2.0.45 version to fix the extended
enum syntax, and cover the use case with tests for future regressions.
  • Loading branch information
tyranron authored Mar 15, 2024
1 parent 583efb8 commit 2a001d6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
syn = "2.0"
syn = "2.0.45"
convert_case = { version = "0.6", optional = true }
unicode-xid = { version = "0.2.2", optional = true }

Expand Down
18 changes: 18 additions & 0 deletions tests/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1914,3 +1914,21 @@ mod generic {
}
}
}

// See: https://github.com/JelteF/derive_more/issues/301
mod complex_enum_syntax {
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, format};

use derive_more::Debug;

#[derive(Debug)]
enum Enum {
A = if cfg!(unix) { 2 } else { 3 },
}

#[test]
fn assert() {
assert_eq!(format!("{:?}", Enum::A), "A");
}
}

0 comments on commit 2a001d6

Please sign in to comment.