3 #![allow(unused_variables)]
4 // This is an example where the older inference algorithm failed. The
5 // specifics of why it failed are somewhat, but not entirely, tailed
6 // to the algorithm. Ultimately the problem is that when computing the
7 // mutual supertype of both sides of the `if` it would be faced with a
8 // choice of tightening bounds or unifying variables and it took the
9 // wrong path. The new algorithm avoids this problem and hence this
10 // example typechecks correctly.
12 // pretty-expanded FIXME #23616
19 type Scope<'a> = &'a ScopeChain<'a>;
27 impl<'a> Context<'a> {
28 fn foo(&mut self, scope: Scope) {
30 let l = ScopeChain::Link(scope);
34 ScopeChain::Link(scope)
36 self.take_scope(&link);
39 fn take_scope(&mut self, x: Scope) {