Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign Into derive macro #248

Merged
merged 59 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
518c1b1
WIP
ilslv Feb 9, 2023
99cb368
Add tests
ilslv Feb 10, 2023
a062ce1
Add tests
ilslv Feb 10, 2023
7f24761
Docs and clippy
ilslv Feb 10, 2023
845558e
Fix unit tests
ilslv Feb 10, 2023
6211b1a
Docs
ilslv Feb 10, 2023
e5ef86e
Port compile_fail tests from `Display` derive macro
ilslv Feb 10, 2023
8c8f9ca
More compile_fail tests
ilslv Feb 10, 2023
6e82741
CHANGELOG
ilslv Feb 10, 2023
7080be8
Reimplement `core::fmt::DebugTuple` to add support for `finish_non_ex…
ilslv Feb 13, 2023
20a0cb0
Docs fmt corrections
ilslv Feb 13, 2023
8c58553
Minor correction
ilslv Feb 13, 2023
5a8cf3a
Minor correction
ilslv Feb 13, 2023
558c2f0
Minor corrections [skip ci]
tyranron Feb 14, 2023
819454e
Restructure the modules and guard `Debug` under a separate `debug` fe…
ilslv Feb 16, 2023
aa2d332
Implement `syn::Type` parsing
ilslv Feb 17, 2023
20d107e
Simplify `syn::Type` parsing with assumptions
ilslv Feb 17, 2023
ea8e31c
Attributes parsing
ilslv Feb 20, 2023
50135d4
Merge branch 'master' into from-attribute
ilslv Mar 7, 2023
0b6ca7b
WIP
ilslv Mar 7, 2023
ce2cd00
WIP
ilslv Mar 7, 2023
61f1a16
WIP
ilslv Mar 8, 2023
0d489d6
Implementation that covers all existing test cases
ilslv Mar 9, 2023
382f185
Exhaustively cover struct with unit tests
ilslv Mar 9, 2023
eac8e27
Exhaustively cover enum and generics with unit tests
ilslv Mar 9, 2023
1ee8c09
More unit tests for generic structs
ilslv Mar 9, 2023
ef8fa47
More unit tests for generic enums
ilslv Mar 10, 2023
f4f874b
More unit tests for generics
ilslv Mar 10, 2023
7df415e
More unit tests for generics
ilslv Mar 10, 2023
87e1058
More unit tests for generics
ilslv Mar 10, 2023
eaa3596
Add compile fail tests
ilslv Mar 10, 2023
ff47628
Skip variants without attributes if another variant has `#[from]` or …
ilslv Mar 10, 2023
9680277
Docs
ilslv Mar 10, 2023
e5f6540
Docs
ilslv Mar 10, 2023
295eb0d
Docs and corrections
ilslv Mar 10, 2023
60430f7
Merge branch 'master' into from-attribute
ilslv Mar 10, 2023
c5b1f77
Clippy
ilslv Mar 10, 2023
14e8361
Corrections
ilslv Mar 10, 2023
1d74fdf
Corrections and changelog
ilslv Mar 10, 2023
249a92c
Corrections
ilslv Mar 10, 2023
0f295f5
WIP
ilslv Mar 13, 2023
e93c5ed
WIP
ilslv Mar 14, 2023
8e5313f
WIP
ilslv Mar 14, 2023
cf598fa
Enhance legacy attribute syntax error
ilslv Mar 16, 2023
0061e68
Error on mixing regular types with wrapped into `owned`/`ref`/`ref_mut`
ilslv Mar 17, 2023
4994298
Exhaustively cover with unit tests
ilslv Mar 17, 2023
8116c7c
Add unit tests for `#[into(skip)]`, compile fail tests and docs
ilslv Mar 17, 2023
e6065db
Corrections
ilslv Mar 17, 2023
96083d3
Corrections
ilslv Mar 17, 2023
c27c76f
Corrections
ilslv Mar 17, 2023
3a4a893
CHANGELOG
ilslv Mar 17, 2023
2db2f97
Merge branch 'master' into into-attribute
ilslv Jul 14, 2023
5d77999
Corrections
ilslv Jul 14, 2023
efc860b
Corrections
ilslv Jul 14, 2023
7a4de17
Corrections
ilslv Jul 14, 2023
5c1823e
Corrections
ilslv Jul 14, 2023
33767ab
Strip repeated code
tyranron Jul 14, 2023
6898e00
Correct docs
tyranron Jul 14, 2023
08d35f5
Correct tests
tyranron Jul 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- The `DebugCustom` derive is renamed to just `Debug` (gated now under a separate
`debug` feature), and its semantics were changed to be a superset of `std` variant
of `Debug`.
- The `From` derive now uses `#[from(<types>)]` instead of `#[from(types(<types>))]`
and ignores field type itself.
- The `Into` derive now uses `#[into(<types>)]` instead of `#[into(types(<types>))]`
and ignores field type itself.

### New features

Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ derive_more-impl = { version = "=0.99.17", path = "impl" }

[dev-dependencies]
rustversion = "1.0"
static_assertions = "1.1"
trybuild = "1.0.56"

[badges]
Expand Down Expand Up @@ -219,7 +220,7 @@ required-features = ["unwrap"]
[[test]]
name = "compile_fail"
path = "tests/compile_fail/mod.rs"
required-features = ["debug", "display"]
required-features = ["debug", "display", "from", "into"]

[[test]]
name = "no_std"
Expand Down
2 changes: 1 addition & 1 deletion impl/doc/debug.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# What `#[derive(Debug)]` generates

This derive macro is a clever superset of `Debug` from standard library. Additional features include:
- not imposing redudant trait bounds;
- not imposing redundant trait bounds;
- `#[debug(skip)]` attribute to skip formatting struct field or enum variant;
- `#[debug("...", args...)]` to specify custom formatting for a particular struct or enum variant field;
- `#[debug(bounds(...))]` to impose additional custom trait bounds.
Expand Down
Loading