]> git.lizzy.rs Git - rust.git/commit
Fix two bugs in HRTB: 1. Categorize early-vs-late bindings on impls when constructing...
authorNiko Matsakis <niko@alum.mit.edu>
Fri, 5 Dec 2014 01:06:41 +0000 (20:06 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Thu, 11 Dec 2014 00:45:19 +0000 (19:45 -0500)
commitca98fefd04b2a0ccd784f96538c824c49210a418
treee5230aebe1d9cdd1d53d3f070050869c444c7e08
parentc38e73fef53e8520e5170c40713e32ab965a8abe
Fix two bugs in HRTB: 1. Categorize early-vs-late bindings on impls when constructing    generics, so that we don't add unnecessary region parameters. 2. Correct the DeBruijn indices when substituting the self type    into the method signature.

Previously, the DeBruijn index for the self type was not being
adjusted to account for the fn binder. This mean that when late-bound
regions were instantiated, you sometimes wind up with two distinct
lifetimes.

Fixes #19537.
src/librustc_typeck/astconv.rs
src/librustc_typeck/collect.rs
src/test/compile-fail/hrtb-debruijn-in-receiver.rs [new file with mode: 0644]