File tree Expand file tree Collapse file tree 4 files changed +29
-7
lines changed Expand file tree Collapse file tree 4 files changed +29
-7
lines changed Original file line number Diff line number Diff line change 49
49
//! - HH: Hereditary harrop predicates. What Chalk deals in.
50
50
//! Popularized by Lambda Prolog.
51
51
52
- #![ feature( conservative_impl_trait) ]
53
52
#![ feature( crate_in_paths) ]
54
53
#![ feature( crate_visibility_modifier) ]
55
54
#![ feature( dyn_trait) ]
56
55
#![ feature( in_band_lifetimes) ]
57
- #![ feature( match_default_bindings) ]
58
56
#![ feature( macro_vis_matcher) ]
59
57
#![ feature( step_trait) ]
60
- #![ feature( universal_impl_trait) ]
61
58
#![ feature( underscore_lifetimes) ]
62
59
63
60
#[ macro_use] extern crate chalk_macros;
Original file line number Diff line number Diff line change 1
1
#![ recursion_limit = "1024" ]
2
2
#![ cfg_attr( test, feature( test) ) ]
3
- #![ feature( conservative_impl_trait) ]
4
3
#![ feature( catch_expr) ]
5
4
#![ feature( crate_in_paths) ]
6
5
#![ feature( crate_visibility_modifier) ]
7
6
#![ feature( dyn_trait) ]
8
7
#![ feature( in_band_lifetimes) ]
9
8
#![ feature( macro_at_most_once_rep) ]
10
9
#![ feature( macro_vis_matcher) ]
11
- #![ feature( match_default_bindings) ]
12
10
#![ feature( specialization) ]
13
11
#![ feature( step_trait) ]
14
12
#![ feature( underscore_lifetimes) ]
15
- #![ feature( universal_impl_trait) ]
16
13
17
14
extern crate chalk_parse;
18
15
#[ macro_use]
Original file line number Diff line number Diff line change @@ -164,7 +164,10 @@ impl InferenceTable {
164
164
crate fn normalize_lifetime ( & mut self , leaf : & Lifetime , binders : usize ) -> Option < Lifetime > {
165
165
match * leaf {
166
166
Lifetime :: Var ( v) => {
167
- let v1 = self . probe_lifetime_var ( InferenceVariable :: from_depth ( v) ) ?;
167
+ if v < binders {
168
+ return None ;
169
+ }
170
+ let v1 = self . probe_lifetime_var ( InferenceVariable :: from_depth ( v - binders) ) ?;
168
171
Some ( v1. up_shift ( binders) )
169
172
}
170
173
Lifetime :: ForAll ( _) => None ,
Original file line number Diff line number Diff line change @@ -1992,3 +1992,28 @@ fn clauses_in_if_goals() {
1992
1992
}
1993
1993
}
1994
1994
}
1995
+
1996
+ #[ test]
1997
+ fn quantified_types ( ) {
1998
+ test ! {
1999
+ program {
2000
+ trait Foo { }
2001
+ struct fn <' a> { }
2002
+ impl Foo for for <' a> fn <' a> { }
2003
+ }
2004
+
2005
+ goal {
2006
+ for <' a> fn <' a>: Foo
2007
+ } yields {
2008
+ "Unique"
2009
+ }
2010
+
2011
+ goal {
2012
+ forall<' a> { fn <' a>: Foo }
2013
+ } yields {
2014
+ // Lifetime constraints are unsatisfiable
2015
+ "Unique; substitution [], \
2016
+ lifetime constraints [InEnvironment { environment: Env([]), goal: '!2 == '!1 }]"
2017
+ }
2018
+ }
2019
+ }
You can’t perform that action at this time.
0 commit comments