- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
          Improve documentation of slice::from_raw_parts
          #72350
        
          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
          
     Merged
      
      
            bors
  merged 2 commits into
  rust-lang:master
from
danielhenrymantilla:doc_warn_against_adjacent_slice_concat
  
      
      
   
  May 22, 2020 
      
    
                
     Merged
            
            
  
    Improve documentation of slice::from_raw_parts
  
  #72350
              
                    bors
  merged 2 commits into
  rust-lang:master
from
danielhenrymantilla:doc_warn_against_adjacent_slice_concat
  
      
      
   
  May 22, 2020 
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
730119c    to
    8bc3a33      
    Compare
  
    
              
                    RalfJung
  
              
              reviewed
              
                  
                    May 20, 2020 
                  
              
              
            
            
              
                    RalfJung
  
              
              reviewed
              
                  
                    May 20, 2020 
                  
              
              
            
            
              
                    RalfJung
  
              
              reviewed
              
                  
                    May 20, 2020 
                  
              
              
            
            
| Thanks for the PR. :) I just have a few nits. | 
              
                    RalfJung
  
              
              reviewed
              
                  
                    May 21, 2020 
                  
              
              
            
            
              
                    RalfJung
  
              
              reviewed
              
                  
                    May 21, 2020 
                  
              
              
            
            
| Looking good. :) Could you please squash, then I'll r+. | 
This is to provide a more explicit statement against a code pattern that many people end up coming with, since the reason of it being unsound comes from the badly known single-allocation validity rule. Providing that very pattern as a counter-example could help mitigate that. Co-authored-by: Ralf Jung <post@ralfj.de>
3159849    to
    a81e9a7      
    Compare
  
    
              
                    RalfJung
  
              
              reviewed
              
                  
                    May 21, 2020 
                  
              
              
            
            
| Thanks! @bors r+ rollup+ | 
| 📌 Commit 67e0755 has been approved by  | 
| @bors rollup | 
    
  RalfJung 
      added a commit
        to RalfJung/rust
      that referenced
      this pull request
    
      May 21, 2020 
    
    
      
  
    
      
    
  
…t_adjacent_slice_concat, r=RalfJung Improve documentation of `slice::from_raw_parts` This is to provide a more explicit statement against a code pattern that many people end up coming with, since the reason of it being unsound comes from the badly known single-allocation validity rule. Providing that very pattern as a counter-example could help mitigate that. See also: https://internals.rust-lang.org/t/pre-rfc-add-join-seq-method-to-slices-and-strs/11936/13 r? @RalfJung
  This was referenced May 21, 2020 
      
    
  bors 
      added a commit
        to rust-lang-ci/rust
      that referenced
      this pull request
    
      May 21, 2020 
    
    
      
  
    
      
    
  
Rollup of 7 pull requests Successful merges: - rust-lang#72055 (Intern predicates) - rust-lang#72149 (Don't `type_of` on trait assoc ty without default) - rust-lang#72347 (Make intra-link resolve links for both trait and impl items) - rust-lang#72350 (Improve documentation of `slice::from_raw_parts`) - rust-lang#72382 (Show default values for debug-assertions & debug-assertions-std) - rust-lang#72421 (Fix anchor display when hovering impl) - rust-lang#72425 (fix discriminant_value sign extension) Failed merges: r? @ghost
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      Labels
      
    S-waiting-on-bors
  Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This is to provide a more explicit statement against a code pattern that
many people end up coming with, since the reason of it being unsound
comes from the badly known single-allocation validity rule.
Providing that very pattern as a counter-example could help mitigate that.
See also: https://internals.rust-lang.org/t/pre-rfc-add-join-seq-method-to-slices-and-strs/11936/13
r? @RalfJung