about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-03-13 03:33:56 +0100
committerGitHub <noreply@github.com>2019-03-13 03:33:56 +0100
commitc22566d96dc69975570caa8e2c2a82fbfbfd9ae2 (patch)
tree3d73482dc34963e598e499343d479020cebd6e18 /src/libsyntax/parse/parser
parent3623c1ac4edb92e2aabab14c0b36691e970703ea (diff)
parent261daf27c9e4b9332ac8d17fc4f9997fcd1ded3f (diff)
downloadrust-c22566d96dc69975570caa8e2c2a82fbfbfd9ae2.tar.gz
rust-c22566d96dc69975570caa8e2c2a82fbfbfd9ae2.zip
Rollup merge of #59132 - nikomatsakis:issue-53548-generator-bound, r=pnkfelix
ignore higher-ranked object bound conditions created by WF

In the `issue-53548` test added in this PR, 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).

Fixes #53548

r? @pnkfelix
Diffstat (limited to 'src/libsyntax/parse/parser')
0 files changed, 0 insertions, 0 deletions