about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-21 15:29:40 +0100
committerGitHub <noreply@github.com>2019-12-21 15:29:40 +0100
commit1113eb5cc07f19eab34fa7984f08a4ba9fd2c987 (patch)
treefa2b0cd93202f26c9fe26bd435edca5f95c34607 /src/libsyntax
parentc64eecf4d0907095928fb36fd3a1dd5fb2d9ff06 (diff)
parentb08d697236b236e96b0e8e6894e05aefe5a11b39 (diff)
downloadrust-1113eb5cc07f19eab34fa7984f08a4ba9fd2c987.tar.gz
rust-1113eb5cc07f19eab34fa7984f08a4ba9fd2c987.zip
Rollup merge of #67059 - TommasoBianchi:dropck_fix_pr, r=pnkfelix
Fix too restrictive checks on Drop impls

Fixes #34426. Fixes #58311.

This PR completes and extends #59497 (which has been inactive for a while now).
The problem generating both issues was that when checking that the `Predicate`s of the `Drop` impl are exactly the same as the ones of the struct definition, the check was essentially performed by a simple `==` operator, which was not handling correctly HRTBs and involved `Fn` types.

The implemented solution relies on the `relate` machinery to more correctly equate `Predicate`s, and on `anonymize_late_bound_regions` to handle HRTB in a more general way. As the `Relate` trait currently is implemented only for `TraitPredicate` and `ProjectionPredicate` (and as they were the ones generating problems), `relate` is used only for them while for other `Predicate`s the equality check is kept. I'm currently considering whether it would make sense to implement the `Relate` trait also for all other `Predicate`s to render the proposed solution more general.
Diffstat (limited to 'src/libsyntax')
0 files changed, 0 insertions, 0 deletions