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

Rollup of 6 pull requests #67917

Merged
merged 22 commits into from
Jan 6, 2020
Merged

Rollup of 6 pull requests #67917

merged 22 commits into from
Jan 6, 2020

Commits on Jan 4, 2020

  1. Configuration menu
    Copy the full SHA
    c09dac1 View commit details
    Browse the repository at this point in the history
  2. add tests

    Dylan-DPC committed Jan 4, 2020
    Configuration menu
    Copy the full SHA
    eb36688 View commit details
    Browse the repository at this point in the history
  3. ef em ti ... :P

    Dylan-DPC committed Jan 4, 2020
    Configuration menu
    Copy the full SHA
    f744ea0 View commit details
    Browse the repository at this point in the history
  4. removed blank line

    Dylan-DPC committed Jan 4, 2020
    Configuration menu
    Copy the full SHA
    358b898 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2020

  1. add feature gate

    Dylan-DPC committed Jan 5, 2020
    Configuration menu
    Copy the full SHA
    e03d1c4 View commit details
    Browse the repository at this point in the history
  2. Use as_deref() to replace as_ref().map(...)

    Suggested by @lzutao
    pickfire committed Jan 5, 2020
    Configuration menu
    Copy the full SHA
    3d857ef View commit details
    Browse the repository at this point in the history
  3. Fix ICE involving calling Instance.ty during const evaluation

    Fixes rust-lang#67639
    
    `Instance.ty` assumes that we are in a fully monomorphic context (e.g.
    codegen), and can therefore use an empty `ParamEnv` when performing
    normalization. Howver, the MIR constant evaluator code ends up calling
    `Instance.ty` as a result of us attemptign to 'speculatively'
    const-evaluate generic functions during const propagation.
    
    As a result,
    we may end up with projections involving type parameters
    (e.g. <T as MyTrait>::Bar>) in the type we are trying to normalize.
    Normalization expects us to have proper predicates in the `ParamEnv` for
    such projections, and will ICE if we don't.
    
    This commit adds a new method `Instance.ty_env`, which takes a
    `ParamEnv` for use during normalization. The MIR const-evaluator code is
    changed to use this method, passing in the proper `ParamEnv` for the
    context at hand.
    Aaron1011 committed Jan 5, 2020
    Configuration menu
    Copy the full SHA
    ee922d4 View commit details
    Browse the repository at this point in the history
  4. Change 'panic!' to 'bug!'

    Co-Authored-By: Wesley Wiser <wwiser@gmail.com>
    Aaron1011 and wesleywiser committed Jan 5, 2020
    Configuration menu
    Copy the full SHA
    d41f9dd View commit details
    Browse the repository at this point in the history
  5. Run rustfmt

    Aaron1011 committed Jan 5, 2020
    Configuration menu
    Copy the full SHA
    71d163b View commit details
    Browse the repository at this point in the history
  6. s/projections/params/

    Aaron1011 committed Jan 5, 2020
    Configuration menu
    Copy the full SHA
    464b58c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    33caf0b View commit details
    Browse the repository at this point in the history
  8. Fix typo

    Aaron1011 committed Jan 5, 2020
    Configuration menu
    Copy the full SHA
    db2c4f2 View commit details
    Browse the repository at this point in the history
  9. Silence TooGeneric error

    This error may be produced during intermediate failed attempts at evaluation of a generic const, which may nevertheless succeed later.
    varkor committed Jan 5, 2020
    Configuration menu
    Copy the full SHA
    adb46fd View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    336b902 View commit details
    Browse the repository at this point in the history

Commits on Jan 6, 2020

  1. macros: typo fix

    spotted while reviewing the todo!macro docs
    LPardue committed Jan 6, 2020
    Configuration menu
    Copy the full SHA
    cb8c071 View commit details
    Browse the repository at this point in the history
  2. Use Self instead of $type

    tesuji committed Jan 6, 2020
    Configuration menu
    Copy the full SHA
    c7dbf5a View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#67800 - Aaron1011:fix/mir-generic-instance,…

    … r=oli-obk
    
    Fix ICE involving calling `Instance.ty` during const evaluation
    
    Fixes rust-lang#67639
    
    `Instance.ty` assumes that we are in a fully monomorphic context (e.g.
    codegen), and can therefore use an empty `ParamEnv` when performing
    normalization. Howver, the MIR constant evaluator code ends up calling
    `Instance.ty` as a result of us attemptign to 'speculatively'
    const-evaluate generic functions during const propagation.
    
    As a result,
    we may end up with projections involving type parameters
    (e.g. <T as MyTrait>::Bar>) in the type we are trying to normalize.
    Normalization expects us to have proper predicates in the `ParamEnv` for
    such projections, and will ICE if we don't.
    
    This commit adds a new method `Instance.ty_env`, which takes a
    `ParamEnv` for use during normalization. The MIR const-evaluator code is
    changed to use this method, passing in the proper `ParamEnv` for the
    context at hand.
    Dylan-DPC committed Jan 6, 2020
    Configuration menu
    Copy the full SHA
    3692075 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#67873 - Dylan-DPC:feature/change-remove-to-…

    …partial, r=Amanieu
    
    change remove to have a PartialEq bound
    
    Addresses [comment](rust-lang#67727 (comment)).
    
    References rust-lang#40062
    
    r? @Amanieu
    Dylan-DPC committed Jan 6, 2020
    Configuration menu
    Copy the full SHA
    005d9d5 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#67897 - pickfire:patch-1, r=Dylan-DPC

    Use `as_deref()` to replace `as_ref().map(...)`
    
    Suggested by @lzutao
    Dylan-DPC committed Jan 6, 2020
    Configuration menu
    Copy the full SHA
    2e965e9 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#67906 - varkor:silence-toogeneric, r=nagisa

    Silence `TooGeneric` error
    
    This error may be produced during intermediate failed attempts at evaluation of a generic const, which may nevertheless succeed later.
    
    Fixes rust-lang#66962.
    
    r? @eddyb
    Dylan-DPC committed Jan 6, 2020
    Configuration menu
    Copy the full SHA
    c79034e View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#67912 - LPardue:patch-1, r=Centril

    macros: typo fix
    
    spotted while reviewing the todo!macro docs
    Dylan-DPC committed Jan 6, 2020
    Configuration menu
    Copy the full SHA
    162154f View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#67915 - lzutao:Self, r=Centril

    Use Self instead of $type
    
    r? @Dylan-DPC
    Dylan-DPC committed Jan 6, 2020
    Configuration menu
    Copy the full SHA
    34716a3 View commit details
    Browse the repository at this point in the history