Conversation
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
|
Does this also fix #42? |
| let input = parse_macro_input!(input as AllTuples); | ||
| let len = 1 + input.end - input.start; | ||
| let ident_tuples = (0..=len) | ||
| let ident_tuples = (0..input.end) |
There was a problem hiding this comment.
Please add a test case to make sure that if the input is 16 to 20, then it is not implemented for 0..=15. I have a suspicion.
There was a problem hiding this comment.
I first add a test 3..15, then it conflicts with the original 1..15, so I believe 16..20 doesn’t impl for 1..15. 1..15and 15..20 are in the same block in doc, if 15..20 implemented for 1..15 again, it would not compile. Maybe current test is enough...
EDIT: I only added test in all_tuples and forgot others...
|
I think it happens to fix #42 too. Because in this PR, only format idents needed (i.e. if |
Objective
fixes #37
Solution
At first, I feel this part is strange:
If end = 2, start = 0, then len = 3. But ident_tuples has 4 elements, while we only need 2.
I make changes to it first, and then #37 just fixed.
Testing
RUSTFLAGS="--cfg docsrs" cargo +nightly expand --example all_tuplesAnd got
I open doc with this cmd
RUSTFLAGS="--cfg docsrs" cargo +nightly doc --open --example all_tuplesBut the fake_variadics is not right. I believe it's due to I missed some flags and it'll be right when publishing onto cratesio.
However, I'm not very sure.
Use correct command to check
cargo docresultMine is incorrect:
RUSTFLAGS="--cfg docsrs" cargo +nightly doc --open --example all_tuplesBy the way,
doc_auto_cfgtodoc_cfg, since they are merged since Rust nightly 1.92. And docs.rs uses nightly Rust. Anyway, this crate has no features gate, there's no effect I think.