@@ -27,7 +27,7 @@ pub trait region_scope {
27
27
pub enum empty_rscope { empty_rscope }
28
28
impl region_scope for empty_rscope {
29
29
fn anon_region ( & self , _span : span ) -> Result < ty:: Region , ~str > {
30
- Ok ( ty :: re_static )
30
+ result :: Err ( ~"only the static region is allowed here" )
31
31
}
32
32
fn self_region ( & self , _span : span ) -> Result < ty:: Region , ~str > {
33
33
result:: Err ( ~"only the static region is allowed here")
@@ -62,14 +62,14 @@ impl region_scope for MethodRscope {
62
62
pub enum type_rscope = Option < ty : : region_variance > ;
63
63
impl region_scope for type_rscope {
64
64
fn anon_region ( & self , _span: span) -> Result <ty:: Region , ~str > {
65
- // if the anon or self region is used, region parameterization should
65
+ result:: Err ( ~"anonymous region types are not permitted here")
66
+ }
67
+ fn self_region( & self , _span: span) -> Result <ty:: Region , ~str > {
68
+ // if the self region is used, region parameterization should
66
69
// have inferred that this type is RP
67
70
assert self. is_some ( ) ;
68
71
result:: Ok ( ty:: re_bound ( ty:: br_self) )
69
72
}
70
- fn self_region( & self , span: span) -> Result <ty:: Region , ~str > {
71
- self . anon_region ( span)
72
- }
73
73
fn named_region( & self , span: span, id: ast:: ident)
74
74
-> Result <ty:: Region , ~str > {
75
75
do empty_rscope. named_region ( span, id) . chain_err |_e| {
@@ -87,33 +87,6 @@ pub fn bound_self_region(rp: Option<ty::region_variance>)
87
87
}
88
88
}
89
89
90
- pub struct anon_rscope { anon : ty:: Region , base : @region_scope }
91
- pub fn in_anon_rscope < RS : region_scope + Copy + Durable > (
92
- self : & RS ,
93
- r : ty:: Region ) -> anon_rscope
94
- {
95
- let base = @( copy * self ) as @region_scope ;
96
- anon_rscope { anon : r, base : base}
97
- }
98
- impl region_scope for anon_rscope {
99
- fn anon_region ( & self ,
100
- _span : span ) -> Result < ty:: Region , ~str >
101
- {
102
- result:: Ok ( self . anon )
103
- }
104
- fn self_region ( & self ,
105
- span : span ) -> Result < ty:: Region , ~str >
106
- {
107
- self . base . self_region ( span)
108
- }
109
- fn named_region ( & self ,
110
- span : span ,
111
- id : ast:: ident ) -> Result < ty:: Region , ~str >
112
- {
113
- self . base . named_region ( span, id)
114
- }
115
- }
116
-
117
90
pub struct binding_rscope {
118
91
base : @region_scope ,
119
92
anon_bindings : @mut uint ,
0 commit comments