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

Use NonNull in the allocator API #49608

Closed
wants to merge 1 commit into from
Closed

Commits on Apr 4, 2018

  1. Use NonNull in the allocator API

    As discussed in rust-lang#32838 (comment)
    and following, instead of *mut pointers, use NonNull for the allocator
    API.
    
    One issue is that older rustc versions, used to bootstrap the compiler,
    expands #[global_allocator], used in various places including libstd or
    librustc_[almt]san, to code that uses the Alloc trait, so changes to
    that trait make bootstrapping fail. Thankfully, it does so through the
    location of the Alloc trait before 94d1970
    so we can use at our advantage by making stage0 expose the old API as
    alloc::heap::Alloc.
    
    At the same time, we change the expansion for #[global_allocator] to use
    the new trait location under core, which will allow newer versions of
    rustc to bootstrap stage0 as well, despite the workaround described above.
    glandium committed Apr 4, 2018
    Configuration menu
    Copy the full SHA
    8f924a3 View commit details
    Browse the repository at this point in the history