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

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

Merged
merged 1 commit into from
Oct 25, 2018

Commits on Oct 21, 2018

  1. only issue "variant of the expected type" suggestion for enums

    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`).
    
    Resolves rust-lang#55250.
    zackmdavis committed Oct 21, 2018
    Configuration menu
    Copy the full SHA
    b0d3d3b View commit details
    Browse the repository at this point in the history