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

ignore higher-ranked object bound conditions created by WF #59132

Merged
merged 2 commits into from
Mar 13, 2019

Commits on Mar 12, 2019

  1. Configuration menu
    Copy the full SHA
    4632e33 View commit details
    Browse the repository at this point in the history
  2. ignore higher-ranked WF requirements for trait objects

    In the `issue-53548` test added in this commit, the `Box<dyn Trait>`
    type is expanded to `Box<dyn Trait + 'static>`, but the generator
    "witness" that results is `for<'r> { Box<dyn Trait + 'r> }`. The WF
    code was encountering an ICE (when debug-assertions were enabled) and
    an unexpected compilation error (without debug-asserions) when trying
    to process this `'r` region bound. In particular, to be WF, the region
    bound must meet the requirements of the trait, and hence we got
    `for<'r> { 'r: 'static }`. This would ICE because the `Binder`
    constructor we were using was assering that no higher-ranked regions
    were involved (because the WF code is supposed to skip those). The
    error (if debug-asserions were disabled) came because we obviously
    cannot prove that `'r: 'static` for any region `'r`.  Pursuant with
    our "lazy WF" strategy for higher-ranked regions, the fix is not to
    require that `for<'r> { 'r: 'static }` holds (this is also analogous
    to what we would do for higher-ranked regions appearing within the
    trait in other positions).
    nikomatsakis committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    261daf2 View commit details
    Browse the repository at this point in the history