File tree Expand file tree Collapse file tree 3 files changed +59
-2
lines changed Expand file tree Collapse file tree 3 files changed +59
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
10
10
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
11
11
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
12
12
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13
- refs/heads/auto: b92ec6a78a980b567ec8e6c034e3b37caea81aaa
13
+ refs/heads/auto: ff6085f401844bc5cb07b804f0d2258bb5c2b9a8
14
14
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
15
15
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
16
16
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
Original file line number Diff line number Diff line change @@ -2604,12 +2604,17 @@ impl FlagComputation {
2604
2604
2605
2605
& ty_projection( ref data) => {
2606
2606
self . add_flags ( HAS_PROJECTION ) ;
2607
- self . add_substs ( data. trait_ref . substs ) ;
2607
+ self . add_projection_ty ( data) ;
2608
2608
}
2609
2609
2610
2610
& ty_trait( box TyTrait { ref principal, ref bounds } ) => {
2611
2611
let mut computation = FlagComputation :: new ( ) ;
2612
2612
computation. add_substs ( principal. 0 . substs ) ;
2613
+ for projection_bound in bounds. projection_bounds . iter ( ) {
2614
+ let mut proj_computation = FlagComputation :: new ( ) ;
2615
+ proj_computation. add_projection_predicate ( & projection_bound. 0 ) ;
2616
+ computation. add_bound_computation ( & proj_computation) ;
2617
+ }
2613
2618
self . add_bound_computation ( & computation) ;
2614
2619
2615
2620
self . add_bounds ( bounds) ;
@@ -2673,6 +2678,15 @@ impl FlagComputation {
2673
2678
}
2674
2679
}
2675
2680
2681
+ fn add_projection_predicate ( & mut self , projection_predicate : & ProjectionPredicate ) {
2682
+ self . add_projection_ty ( & projection_predicate. projection_ty ) ;
2683
+ self . add_ty ( projection_predicate. ty ) ;
2684
+ }
2685
+
2686
+ fn add_projection_ty ( & mut self , projection_ty : & ProjectionTy ) {
2687
+ self . add_substs ( projection_ty. trait_ref . substs ) ;
2688
+ }
2689
+
2676
2690
fn add_substs ( & mut self , substs : & Substs ) {
2677
2691
self . add_tys ( substs. types . as_slice ( ) ) ;
2678
2692
match substs. regions {
Original file line number Diff line number Diff line change
1
+ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // Corrected regression test for #20831. The original did not compile.
12
+ // When fixed, it revealed another problem concerning projections that
13
+ // appear in associated type bindings in object types, which were not
14
+ // being properly flagged.
15
+
16
+ use std:: ops:: { Shl , Shr } ;
17
+ use std:: cell:: RefCell ;
18
+
19
+ pub trait Subscriber {
20
+ type Input ;
21
+ }
22
+
23
+ pub trait Publisher < ' a > {
24
+ type Output ;
25
+ fn subscribe ( & mut self , Box < Subscriber < Input =Self :: Output > + ' a > ) ;
26
+ }
27
+
28
+ pub trait Processor < ' a > : Subscriber + Publisher < ' a > { }
29
+
30
+ impl < ' a , P > Processor < ' a > for P where P : Subscriber + Publisher < ' a > { }
31
+
32
+ struct MyStruct < ' a > {
33
+ sub : Box < Subscriber < Input =u64 > + ' a >
34
+ }
35
+
36
+ impl < ' a > Publisher < ' a > for MyStruct < ' a > {
37
+ type Output = u64 ;
38
+ fn subscribe ( & mut self , t : Box < Subscriber < Input =u64 > + ' a > ) {
39
+ self . sub = t;
40
+ }
41
+ }
42
+
43
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments