- 
                Notifications
    
You must be signed in to change notification settings  - Fork 129
 
[macros] Support shrinking reference transmutes #2487
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
          
     Open
      
      
            joshlf
  wants to merge
  1
  commit into
  I6c793a9620ad75bdc0d26ab7c7cd1a0c7bef1b8b
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
I10874e2bc703fb6b7fcdea050b8971de869a850a
  
      
      
   
  
    
  
  
  
 
  
      
    base: I6c793a9620ad75bdc0d26ab7c7cd1a0c7bef1b8b
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
                
     Open
            
            [macros] Support shrinking reference transmutes #2487
                    joshlf
  wants to merge
  1
  commit into
  I6c793a9620ad75bdc0d26ab7c7cd1a0c7bef1b8b
from
I10874e2bc703fb6b7fcdea050b8971de869a850a
  
      
      
   
              
            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 was referenced Apr 7, 2025 
      
7e3c9df    to
    cc7b98d      
    Compare
  
    eec3ec9    to
    bafb400      
    Compare
  
    149d455    to
    f0a9dcf      
    Compare
  
    bafb400    to
    0386dc9      
    Compare
  
    f0a9dcf    to
    8515ac1      
    Compare
  
    0386dc9    to
    8793f97      
    Compare
  
    5a78ea6    to
    a1883ff      
    Compare
  
    8793f97    to
    491b473      
    Compare
  
    a1883ff    to
    9d89a72      
    Compare
  
    0e678af    to
    ed98af3      
    Compare
  
    9d89a72    to
    681bec1      
    Compare
  
    ed98af3    to
    f9e4d83      
    Compare
  
    681bec1    to
    56f691c      
    Compare
  
    f9e4d83    to
    a7bb504      
    Compare
  
    2beca4e    to
    d8ed221      
    Compare
  
    97e2096    to
    20f0bc3      
    Compare
  
    d8ed221    to
    9c78c59      
    Compare
  
    feb1f37    to
    a2f2308      
    Compare
  
    18a049a    to
    cd0c968      
    Compare
  
    31b5471    to
    291b87b      
    Compare
  
    cd0c968    to
    10e1604      
    Compare
  
    291b87b    to
    9b25166      
    Compare
  
    10e1604    to
    d494109      
    Compare
  
    3d8da5b    to
    88213f3      
    Compare
  
    d494109    to
    67b20da      
    Compare
  
    
  This was referenced Jun 9, 2025 
      
67b20da    to
    52f78f3      
    Compare
  
    e430a16    to
    4abed50      
    Compare
  
    10ae313    to
    fe7ab51      
    Compare
  
    4abed50    to
    7e1bf34      
    Compare
  
    fe7ab51    to
    a0e259a      
    Compare
  
    d3aad92    to
    9fda82b      
    Compare
  
    a0e259a    to
    91eb2e0      
    Compare
  
    9fda82b    to
    eef2e15      
    Compare
  
    24b1350    to
    a6c1b4c      
    Compare
  
    eef2e15    to
    3fc3abf      
    Compare
  
    In `transmute_ref!` and `transmute_mut!`, support an `#![allow(shrink)]` attribute which is invoked as follows: transmute_ref!(#![allow(shrink)] src); When this attribute is provided, the macros will permit shrinking transmutes, in which the destination value may be smaller than the source value. Makes progress on #1817 Co-authored-by: Jack Wrenn <[email protected]> gherrit-pr-id: I10874e2bc703fb6b7fcdea050b8971de869a850a
a6c1b4c    to
    980e1e4      
    Compare
  
    3fc3abf    to
    ed008e8      
    Compare
  
    
      
        
      
      
  
    11 tasks
  
      
        
      
      
  
    6 tasks
  
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  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.
  
    
  
    
In
transmute_ref!andtransmute_mut!, support an#![allow(shrink)]attribute which is invoked as follows:
transmute_ref!(#![allow(shrink)] src);
When this attribute is provided, the macros will permit shrinking
transmutes, in which the destination value may be smaller than the
source value.
Makes progress on #1817
Co-authored-by: Jack Wrenn [email protected]
This PR is on branch transmute-ref-dst.