- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Check arg/ret sizedness at ExprKind::Path #56045
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
      
        
      
    
                
     Merged
            
            
          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
    
  
  
    
    | r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) | 
| @bors r+ | 
| 📌 Commit 1cd4ab2067f94bd378c02f5ce6f44d1b84c6867a has been approved by  | 
| ☔ The latest upstream changes (presumably #52591) made this pull request unmergeable. Please resolve the merge conflicts. | 
1cd4ab2    to
    c6a803a      
    Compare
  
    | r? @cramertj | 
| @bors r+ | 
| 📌 Commit c6a803a has been approved by  | 
    
  pietroalbini 
      added a commit
        to pietroalbini/rust
      that referenced
      this pull request
    
      Nov 25, 2018 
    
    
      
  
    
      
    
  
…ertj Check arg/ret sizedness at ExprKind::Path This PR solves three problems: - rust-lang#50940: ICE on casting unsized tuple struct constructors - Unsized tuple struct constructors were callable in presence of `unsized_locals`. - rust-lang#48055 (comment): we cannot relax `Sized` bounds on stable functions because of fn ptr casting These are caused by lack of `Sized`ness checks for arguments/retvals at **reference sites of `FnDef` items** (not call sites of the functions). Therefore we can basically add more `Sized` obligations on typeck. However, adding `Sized` obligations arbitrarily breaks type inference; to prevent that I added a new method `require_type_is_sized_deferred` which doesn't interfere usual type inference.
    
  bors 
      added a commit
      that referenced
      this pull request
    
      Nov 25, 2018 
    
    
      
  
    
      
    
  
Rollup of 14 pull requests Successful merges: - #56024 (Don't auto-inline const functions) - #56045 (Check arg/ret sizedness at ExprKind::Path) - #56072 (Stabilize macro_literal_matcher) - #56075 (Encode a custom "producers" section in wasm files) - #56100 (generator fields are not necessarily initialized) - #56101 (Incorporate `dyn` into more comments and docs.) - #56144 (Fix BTreeSet and BTreeMap gdb pretty-printers) - #56151 (Move a flaky process test out of libstd) - #56170 (Fix self profiler ICE on Windows) - #56176 (Panic setup msg) - #56204 (Suggest correct enum variant on typo) - #56207 (Stabilize the int_to_from_bytes feature) - #56210 (read_c_str should call the AllocationExtra hooks) - #56211 ([master] Forward-ports from beta) Failed merges: r? @ghost
  This was referenced Nov 27, 2018 
      
  
    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 PR solves three problems:
unsized_locals.Sizedbounds on stable functions because of fn ptr castingThese are caused by lack of
Sizedness checks for arguments/retvals at reference sites ofFnDefitems (not call sites of the functions). Therefore we can basically add moreSizedobligations on typeck. However, addingSizedobligations arbitrarily breaks type inference; to prevent that I added a new methodrequire_type_is_sized_deferredwhich doesn't interfere usual type inference.