Skip to content

Disallow default_value and required for Option - #88

Merged
TeXitoi merged 2 commits into
TeXitoi:masterfrom
Kerollmops:no-default-for-option
Apr 6, 2018
Merged

Disallow default_value and required for Option#88
TeXitoi merged 2 commits into
TeXitoi:masterfrom
Kerollmops:no-default-for-option

Conversation

@Kerollmops

Copy link
Copy Markdown
Contributor

No description provided.

@Kerollmops

Copy link
Copy Markdown
ContributorAuthor

Tests passes on rustc 1.26-nightly on my macbook pro.

@TeXitoiTeXitoi left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests fails with cargo test --features nightly. I can't look at it now.

@TeXitoi

Copy link
Copy Markdown
Owner

Please add a line in the changelog

@Kerollmops

Kerollmops commented Apr 2, 2018

Copy link
Copy Markdown
ContributorAuthor

We should probably bump the major number because this is not a backward compatible update, it will break current compiling code. https://semver.org/

@TeXitoi

Copy link
Copy Markdown
Owner

I've said in 0.2 that I can break compilation for better error handling, thus no major version change for that.

@TeXitoi

Copy link
Copy Markdown
Owner

The failing test also fail on master. Maybe syn and quote are not yet synchronised with nightly.

Only the first doc comment is given by syn.

rust-lang/rust#49545 may be related to this.

I didn't understand the problem I do t know where reporting the issue. Maybe syn? @dtolnay any idea?

@TeXitoi

Copy link
Copy Markdown
Owner

Required is also meaningless with option.

@KerollmopsKerollmops changed the title Remove meaningless default value on option valuesRemove meaningless default value and required on OptionApr 2, 2018
Comment threadCHANGELOG.md Outdated
@@ -1,3 +1,7 @@
# v0.2.7 (unreleased)

* Fail compilation when using `default_value` with `Option` ([#88](https://github.com/TeXitoi/structopt/pull/88)) by [@Kerollmops](https://github.com/Kerollmops)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not updated accordingly.

@KerollmopsKerollmops changed the title Remove meaningless default value and required on OptionDisallow default_value and required for OptionApr 2, 2018
@dtolnay

Copy link
Copy Markdown

Thanks for the ping. I filed rust-lang/rust#49596 to follow up.

@TeXitoi

Copy link
Copy Markdown
Owner

Fixed in nightly for our case.

Thanks for the contribution and your patience.

@TeXitoi
TeXitoi merged commit 6a39e59 into TeXitoi:masterApr 6, 2018
Comment threadCHANGELOG.md
@@ -1,3 +1,7 @@
# v0.2.7 (unreleased)

* Fail compilation when using `default_value` and `required` with `Option` ([#88](https://github.com/TeXitoi/structopt/pull/88)) by [@Kerollmops](https://github.com/Kerollmops)

@KerollmopsKerollmopsApr 6, 2018

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/and/or 😞

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amended

TeXitoi pushed a commit that referenced this pull request Apr 6, 2018
Sign up for freeto 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.

3 participants

@Kerollmops@TeXitoi@dtolnay