Skip to content

Use ManuallyDrop #62

Description

@bluss

ManuallyDrop is stable in Rust 1.20 (not yet released).

This is the official nodrop that arrayvec has been waiting a long time for; it's likely that we will use Rust 1.20 as the new required version from this point.

Activity

  1. bluss commented on Aug 2, 2017

    @bluss
    OwnerAuthor

    Consider using version_check which is small enough to be worth it(?)

  2. tbu- commented on Aug 3, 2017

    @tbu-
    Collaborator

    This can only get the version at runtime – do you want to add a build script?

  3. bluss commented on Aug 3, 2017

    @bluss
    OwnerAuthor

    Yep, exactly.

    Example https://github.com/bluss/debugit/blob/master/build.rs (this one is checking nightly and not the version..)

  4. bluss commented on Aug 6, 2017

    @bluss
    OwnerAuthor

    We can handle this without breaks, as long as the minimum rust version is reasonable (not 1.2).

    However, the question of uninit data inside manuallydrop is unresolved, so we can't really start to use it without including other workarounds too.

  5. niklasf commented on Sep 29, 2017

    @niklasf
    Contributor

    Looks like f33c4e4 snuck in ManuallyDrop if the use_union feature is set 🎉

    Is there anything left to do, besides version detection, before it can entirely replace nodrop?

  6. bluss commented on Sep 29, 2017

    @bluss
    OwnerAuthor

    sigh, that was not intended :(

  7. bluss commented on Sep 29, 2017

    @bluss
    OwnerAuthor

    It's fine to use ManuallyDrop for use_union. What remains for arrayvec 1.0 is to answer the question about uninitialized data in ManuallyDrop. There was some disagreement in #rustc.

  8. bluss commented on Sep 29, 2017

    @bluss
    OwnerAuthor

    Thanks for pointing out that it snuck in, by the way. It was obviously not intended to sneak in.

  9. tbu- commented on Oct 1, 2017

    @tbu-
    Collaborator

    Can you link to the discussion about uninit data in ManuallyDrop?

  10. bluss commented on Oct 1, 2017

    @bluss
    OwnerAuthor

    The discussion is here: https://botbot.me/mozilla/rustc/2017-08-24/?msg=90238011&page=3

    There are different opinions. I don't think specific people are wrong here, but my collected impression was that there is no consensus on the safety of uninitialized in ManuallyDrop

  11. tbu- commented on Oct 1, 2017

    @tbu-
    Collaborator

    Your idea of making a union union MaybeInitialized<T>{ t: T, uninit: () } sounds good and forward-compatible if the O(n) cost gets optimized out by the compiler.

  12. bluss commented on Nov 4, 2017

    @bluss
    OwnerAuthor

    Current wip is #76

  13. bluss commented on Jul 11, 2019

    @bluss
    OwnerAuthor

    Closed in favour of #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions