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

treat nil parents as empty tables if required #627

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Dec 27, 2024

Encountered this regression via nextest's test suite (nextest-rs/nextest#2001). If a table is empty, it would be treated as a unit value. If attempted to be deserialized via a Default impl, this would lead to deserialization failing with an error like

profile.default-miri: invalid type: unit value, expected struct CustomProfileImpl

A bisect appears to indicate that ec36bff is responsible.

I've attempted to restore the old behavior of putting in an empty table, specifically this section:

ec36bff#diff-c5423e2d2d6c87501239c0304c0f496742e00440defdd20368cf548ba42ab184L175-L178

I'm happy to make changes if there's a better approach.

I've also added some tests for a few situations around empty tables. In this case only the last one (profile.baz) regressed, but I've also added tests for a couple other cases.

Encountered this regression via nextest's test suite
(nextest-rs/nextest#2001). If a table is empty,
it would be treated as a unit value. If attempted to be deserialized
via a `Default` impl, it would lead to deserialization failing with an
error like

```console
profile.default-miri: invalid type: unit value, expected struct CustomProfileImpl
```

A bisect appears to indicate that
ec36bff is responsible. For empty
tables where the Default impl is supposed to work, it no longer would.

I've attempted to restore the old behavior of putting in an empty
table, specifically this section:

rust-cli@ec36bff#diff-c5423e2d2d6c87501239c0304c0f496742e00440defdd20368cf548ba42ab184L175-L178

I'm happy to make changes if there's a better approach.

I've also added some tests for a few situations around empty tables. In
this case only the last one (`profile.baz`) regressed, but I've also
added tests for a couple other cases.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12510158249

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 64.801%

Files with Coverage Reduction New Missed Lines %
src/path/mod.rs 1 90.0%
Totals Coverage Status
Change from base Build 12435004525: -0.02%
Covered Lines: 926
Relevant Lines: 1429

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants