@@ -4,9 +4,47 @@ use derive_where::derive_where;
44use indexmap:: IndexSet ;
55#[ cfg( feature = "nightly" ) ]
66use rustc_data_structures:: stable_hasher:: { StableHash , StableHashCtxt , StableHasher } ;
7+ #[ cfg( feature = "nightly" ) ]
78use rustc_data_structures:: transitive_relation:: { TransitiveRelation , TransitiveRelationBuilder } ;
89use tracing:: { debug, instrument} ;
910
11+ // Workaround for TransitiveRelation being in rustc_data_structures which isn't accessible on stable
12+ #[ cfg( not( feature = "nightly" ) ) ]
13+ #[ derive( Default , Clone , Debug ) ]
14+ pub struct TransitiveRelation < T > ( T ) ;
15+ #[ cfg( not( feature = "nightly" ) ) ]
16+ impl < T > TransitiveRelation < T > {
17+ pub fn reachable_from ( & self , _data : T ) -> Vec < T > {
18+ unreachable ! ( "-Zassumptions-on-binders is not supported for r-a" )
19+ }
20+
21+ pub fn base_edges ( & self ) -> impl Iterator < Item = ( T , T ) > {
22+ unreachable ! ( "-Zassumptions-on-binders is not supported for r-a" ) ;
23+
24+ #[ allow( unreachable_code) ]
25+ [ ] . into_iter ( )
26+ }
27+ }
28+ #[ derive( Clone , Debug ) ]
29+ #[ cfg( not( feature = "nightly" ) ) ]
30+ pub struct TransitiveRelationBuilder < T > ( T ) ;
31+ #[ cfg( not( feature = "nightly" ) ) ]
32+ impl < T > TransitiveRelationBuilder < T > {
33+ pub fn freeze ( self ) -> TransitiveRelation < T > {
34+ unreachable ! ( "-Zassumptions-on-binders is not supported for r-a" )
35+ }
36+
37+ pub fn add ( & mut self , _: T , _: T ) {
38+ unreachable ! ( "-Zassumptions-on-binders is not supported for r-a" )
39+ }
40+ }
41+ #[ cfg( not( feature = "nightly" ) ) ]
42+ impl < T > Default for TransitiveRelationBuilder < T > {
43+ fn default ( ) -> Self {
44+ unreachable ! ( "-Zassumptions-on-binders is not supported for r-a" )
45+ }
46+ }
47+
1048use crate :: data_structures:: IndexMap ;
1149use crate :: fold:: TypeSuperFoldable ;
1250use crate :: inherent:: * ;
0 commit comments