Skip to content

only issue "variant of the expected type" suggestion for enums - #55253

Merged
bors merged 1 commit into
rust-lang:masterfrom
zackmdavis:some_suggestion
Oct 25, 2018
Merged

only issue "variant of the expected type" suggestion for enums#55253
bors merged 1 commit into
rust-lang:masterfrom
zackmdavis:some_suggestion

Conversation

@zackmdavis

Copy link
Copy Markdown
Contributor

This suggestion (introduced in pull-request #43178 / eac7410) was being issued for one-field-struct expected types (in which case it is misleading and outright wrong), even though it was only intended for one-field enum-variants (most notably, Some).

Add a conditional to adhere to the original intent. (It would be possible to generalize to structs, but not obviously net desirable.) This adds a level of indentation, so the diff here is going to be
easier to read in ignore-whitespace mode.

Resolves#55250.

r? @pnkfelix

Felix S. Klock II pointed out that this suggestion (introduced in
pull-request rust-lang#43178 / eac7410) was being issued for one-field-struct
expected types (in which case it is misleading and outright wrong),
even though it was only intended for one-field enum-variants (most
notably, `Some`). Particularly tender-hearted code-historians may be
inclined to show mercy towards the author of rust-lang#43178 on the grounds
that it's somewhat confusing that struct field definitions are given
in a type called `ty::VariantDef`.
Add a conditional to adhere to the original intent. (It would be
possible to generalize to structs, but not obviously net desirable.)
This adds a level of indentation, so the diff here is going to be
easier to read in ignore-whitespace mode (`-w`).
Resolvesrust-lang#55250.
@pnkfelix

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@zackmdavis

Copy link
Copy Markdown
ContributorAuthor

Webhook may not have fired due to the recent troubles?

@bors r=pnkfelix rollup

@bors

bors commented Oct 23, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit b0d3d3b has been approved by pnkfelix

@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 23, 2018
emilyalbini added a commit to emilyalbini/rust that referenced this pull request Oct 23, 2018
only issue "variant of the expected type" suggestion for enums
This suggestion (introduced in pull-request rust-lang#43178 / eac7410) was being issued for one-field-struct expected types (in which case it is misleading and outright wrong), even though it was only intended for one-field enum-variants (most notably, `Some`).
Add a conditional to adhere to the original intent. (It would be possible to generalize to structs, but not obviously net desirable.) This adds a level of indentation, so the diff here is going to be
easier to read in [ignore-whitespace mode](rust-lang@b0d3d3b9?w=1).
Resolvesrust-lang#55250.
r? @pnkfelix
kennytm added a commit to kennytm/rust that referenced this pull request Oct 24, 2018
only issue "variant of the expected type" suggestion for enums
This suggestion (introduced in pull-request rust-lang#43178 / eac7410) was being issued for one-field-struct expected types (in which case it is misleading and outright wrong), even though it was only intended for one-field enum-variants (most notably, `Some`).
Add a conditional to adhere to the original intent. (It would be possible to generalize to structs, but not obviously net desirable.) This adds a level of indentation, so the diff here is going to be
easier to read in [ignore-whitespace mode](rust-lang@b0d3d3b9?w=1).
Resolvesrust-lang#55250.
r? @pnkfelix
@kennytmkennytm mentioned this pull request Oct 24, 2018
emilyalbini added a commit to emilyalbini/rust that referenced this pull request Oct 25, 2018
only issue "variant of the expected type" suggestion for enums
This suggestion (introduced in pull-request rust-lang#43178 / eac7410) was being issued for one-field-struct expected types (in which case it is misleading and outright wrong), even though it was only intended for one-field enum-variants (most notably, `Some`).
Add a conditional to adhere to the original intent. (It would be possible to generalize to structs, but not obviously net desirable.) This adds a level of indentation, so the diff here is going to be
easier to read in [ignore-whitespace mode](rust-lang@b0d3d3b9?w=1).
Resolvesrust-lang#55250.
r? @pnkfelix
bors added a commit that referenced this pull request Oct 25, 2018
Rollup of 22 pull requests
Successful merges:
- #53507 (Add doc for impl From for Waker)
- #53931 (Gradually expanding libstd's keyword documentation)
- #54965 (update tcp stream documentation)
- #54977 (Accept `Option<Box<$t:ty>>` in macro argument)
- #55138 (in which unused-parens suggestions heed what the user actually wrote)
- #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
- #55200 (Documents `From` implementations for `Stdio`)
- #55245 (submodules: update clippy from 5afdf8b to b1d0343)
- #55247 (Clarified code example in char primitive doc)
- #55251 (Fix a typo in the documentation of RangeInclusive)
- #55253 (only issue "variant of the expected type" suggestion for enums)
- #55254 (Correct trailing ellipsis in name_from_pat)
- #55269 (fix typos in various places)
- #55282 (Remove redundant clone)
- #55285 (Do some copy editing on the release notes)
- #55291 (Update stdsimd submodule)
- #55296 (Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs)
- #55306 (Regression test for #54478.)
- #55328 (Fix doc for new copysign functions)
- #55340 (Operands no longer appear in places)
- #55345 (Remove is_null)
- #55348 (Update RELEASES.md after destabilization of non_modrs_mods)
Failed merges:
r? @ghost
@bors
bors merged commit b0d3d3b into rust-lang:masterOct 25, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@zackmdavis@pnkfelix@bors