diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2019-03-12 10:57:06 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2019-03-12 10:57:06 -0400 |
| commit | 261daf27c9e4b9332ac8d17fc4f9997fcd1ded3f (patch) | |
| tree | 59a9bcae17dcb311373c59eeda031aee3f876dc1 /src/libsyntax/parse/parser | |
| parent | 4632e3345b77b3262dd2b33654d9d11d0fc0912d (diff) | |
| download | rust-261daf27c9e4b9332ac8d17fc4f9997fcd1ded3f.tar.gz rust-261daf27c9e4b9332ac8d17fc4f9997fcd1ded3f.zip | |
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).
Diffstat (limited to 'src/libsyntax/parse/parser')
0 files changed, 0 insertions, 0 deletions
