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

Document unsafety in core::ptr #71507

Merged
merged 2 commits into from
Apr 29, 2020

Commits on Apr 23, 2020

  1. doc-example: Refactor pointer name to avoid confusion

    Changed raw pointer name from ptr to raw_pointer to avoid confusion with
    the `use std::ptr` statement a few lines above. This way the crate name
    and pointer name are well differenciated.
    CohenArthur committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    b4a11d4 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2020

  1. safety-ptr: Add SAFETY on some unsafe blocks from libcore/ptr

    Add documentation example to slice_from_raw_parts_mut()
    Add SAFETY explanations to some unsafe blocks in libcore/ptr
    
    * libcore/ptr/mod.rs
    * libcore/ptr/unique.rs
    * libcore/ptr/non_null.rs
    
    safety-mod.rs: Add SAFETY to slice_from_raw_parts(),
    slice_from_raw_parts_mut()
    
    slice_from_raw_parts_mut: Add documentation example
    
    safety-ptr-unique.rs: Add SAFETY to new() and cast()
    
    safety-ptr-non_null.rs: Add SAFETY to new()
    
    safety-ptr-non_null.rs: Add SAFETY to cast()
    
    safety-ptr-non_null.rs: Add SAFETY to from() impls
    
    safety-ptr-unique.rs: Add SAFETY to from() impls
    
    safety-ptr-non_null.rs: Add SAFETY to new()
    
    safety-ptr-unique.rs: Add SAFETY to new()
    
    safety-ptr-mod.rs: Fix safety explanation
    
    rust-lang#71507 (comment)
    
    safety-prt-non_null.rs: Fix SAFETY comment syntax
    
    safety-ptr-unique.rs: Fix syntax for empty()
    
    safety-ptr-non_null.rs: Fix misuse of non-null for align_of()
    
    safety-ptr-non_null.rs: Remove incorrect SAFETY comment
    
    safety-ptr-unique.rs: Remove unsound SAFETY comment
    
    safety-ptr-mod.rs: Add std comment on slice_from_raw_parts guarantee
    
    safety-ptr-unique.rs: Remove incorrect safety comment
    
    Creating a Unique from a NonNull has strict guarantees that the current
    implementation does not guarantee
    
    rust-lang#71507 (comment)
    
    safety-ptr: Re-adding ignore-tidy directive
    CohenArthur committed Apr 29, 2020
    Configuration menu
    Copy the full SHA
    8558ccd View commit details
    Browse the repository at this point in the history