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
Contributor Author

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

@TeXitoi TeXitoi 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

TeXitoi commented Apr 2, 2018

Copy link
Copy Markdown
Owner

Please add a line in the changelog

@Kerollmops

Kerollmops commented Apr 2, 2018

Copy link
Copy Markdown
Contributor Author

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

TeXitoi commented Apr 2, 2018

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

TeXitoi commented Apr 2, 2018

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

TeXitoi commented Apr 2, 2018

Copy link
Copy Markdown
Owner

Required is also meaningless with option.

@Kerollmops Kerollmops changed the title Remove meaningless default value on option values Remove meaningless default value and required on Option Apr 2, 2018
Comment thread CHANGELOG.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.

@Kerollmops Kerollmops changed the title Remove meaningless default value and required on Option Disallow default_value and required for Option Apr 2, 2018
@dtolnay

dtolnay commented Apr 2, 2018

Copy link
Copy Markdown

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

@TeXitoi

TeXitoi commented Apr 6, 2018

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:master Apr 6, 2018
Comment thread CHANGELOG.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)

@Kerollmops Kerollmops Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

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 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.

3 participants