Skip to content

Commit

Permalink
Remove full-syntax feature
Browse files Browse the repository at this point in the history
The primary use-case of full-syntax (complex discriminants) is now
covered by syn even without full, so this feature is unnecessary.

Since bumping the MSRV for syn to 1.56 is a breaking change, we can drop
the full-syntax feature at the same time.
  • Loading branch information
maurer committed Mar 23, 2023
1 parent 80c5e5b commit 8436755
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ syn = "2"
num = "0.3"
num-traits = "0.2"

[features]
full-syntax = ["syn/full"]

[lib]
name = "num_derive"
proc-macro = true
Expand Down
2 changes: 1 addition & 1 deletion ci/test_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if ! check_version $MSRV ; then
exit 1
fi

FEATURES=(full-syntax)
FEATURES=()
echo "Testing supported features: ${FEATURES[*]}"

set -x
Expand Down
10 changes: 1 addition & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,11 @@ use quote::quote;
use syn::{Data, Fields, Ident};

/// Try to parse the tokens, or else return a compilation error
/// suggesting "full-syntax" if that's not already enabled.
macro_rules! parse {
($tokens:ident as $type:ty) => {
match syn::parse::<$type>($tokens) {
Ok(parsed) => parsed,
Err(mut error) => {
if cfg!(not(feature = "full-syntax")) {
let hint = syn::Error::new(
Span::call_site(),
r#"this might need the "full-syntax" feature of `num-derive`"#,
);
error.combine(hint);
}
Err(error) => {
return TokenStream::from(error.to_compile_error());
}
}
Expand Down
2 changes: 0 additions & 2 deletions tests/with_custom_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![cfg(feature = "full-syntax")]

extern crate num as num_renamed;
#[macro_use]
extern crate num_derive;
Expand Down

0 comments on commit 8436755

Please sign in to comment.