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

Fix incorrect clashing_extern_declarations warnings. #73990

Merged
merged 6 commits into from
Jul 30, 2020

Commits on Jul 30, 2020

  1. Configuration menu
    Copy the full SHA
    4da72f5 View commit details
    Browse the repository at this point in the history
  2. Don't emit clashing decl lint for FFI-safe enums.

    An example of an FFI-safe enum conversion is when converting
    Option<NonZeroUsize> to usize. Because the Some value must be non-zero,
    rustc can use 0 to represent the None variant, making this conversion is
    safe. Furthermore, it can be relied on (and removing this optimisation
    already would be a breaking change).
    jumbatm committed Jul 30, 2020
    Configuration menu
    Copy the full SHA
    3eaead7 View commit details
    Browse the repository at this point in the history
  3. Apply suggested wording changes from code review.

    Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
    jumbatm and teymour-aldridge committed Jul 30, 2020
    Configuration menu
    Copy the full SHA
    5e52edc View commit details
    Browse the repository at this point in the history
  4. Address code review comments.

    - Make `is_repr_nullable_ptr` freestanding again to avoid usage of
    ImproperCTypesVisitor in ClashingExternDeclarations (and don't
    accidentally revert the ParamEnv::reveal_all() fix from a week earlier)
    - Revise match condition for 1 Adt, 1 primitive
    - Generalise check for non-null type so that it would also work for
    ranges which exclude any single value (all bits set, for example)
    - Make is_repr_nullable_ptr return the representable type instead of
    just a boolean, to avoid adding an additional, independent "source of
    truth" about the FFI-compatibility of Option-like enums. Also, rename to
    `repr_nullable_ptr`.
    jumbatm committed Jul 30, 2020
    Configuration menu
    Copy the full SHA
    060666d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    30a6f57 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0bd292d View commit details
    Browse the repository at this point in the history