@@ -116,7 +116,7 @@ pub fn ast_region_to_region(
116
116
r
117
117
}
118
118
119
- pub fn opt_ast_region_to_region < AC : AstConv , RS : RegionScope > (
119
+ fn opt_ast_region_to_region < AC : AstConv , RS : RegionScope > (
120
120
this : & AC ,
121
121
rscope : & RS ,
122
122
default_span : Span ,
@@ -129,14 +129,14 @@ pub fn opt_ast_region_to_region<AC:AstConv,RS:RegionScope>(
129
129
130
130
None => {
131
131
match rscope. anon_regions ( default_span, 1 ) {
132
- None => {
132
+ Err ( ( ) ) => {
133
133
debug ! ( "optional region in illegal location" ) ;
134
134
this. tcx ( ) . sess . span_err (
135
135
default_span, "missing lifetime specifier" ) ;
136
136
ty:: ReStatic
137
137
}
138
138
139
- Some ( rs) => {
139
+ Ok ( rs) => {
140
140
rs[ 0 ]
141
141
}
142
142
}
@@ -178,7 +178,7 @@ fn ast_path_substs<AC:AstConv,RS:RegionScope>(
178
178
let anon_regions =
179
179
rscope. anon_regions ( path. span , expected_num_region_params) ;
180
180
181
- if supplied_num_region_params != 0 || anon_regions. is_none ( ) {
181
+ if supplied_num_region_params != 0 || anon_regions. is_err ( ) {
182
182
tcx. sess . span_err (
183
183
path. span ,
184
184
format ! ( "wrong number of lifetime parameters: \
@@ -188,9 +188,9 @@ fn ast_path_substs<AC:AstConv,RS:RegionScope>(
188
188
}
189
189
190
190
match anon_regions {
191
- Some ( v) => opt_vec:: from ( v) ,
192
- None => opt_vec:: from ( vec:: from_fn ( expected_num_region_params,
193
- |_| ty:: ReStatic ) ) // hokey
191
+ Ok ( v) => opt_vec:: from ( v) ,
192
+ Err ( ( ) ) => opt_vec:: from ( vec:: from_fn ( expected_num_region_params,
193
+ |_| ty:: ReStatic ) ) // hokey
194
194
}
195
195
} ;
196
196
@@ -277,8 +277,7 @@ pub static NO_REGIONS: uint = 1;
277
277
pub static NO_TPS : uint = 2 ;
278
278
279
279
// Parses the programmer's textual representation of a type into our
280
- // internal notion of a type. `getter` is a function that returns the type
281
- // corresponding to a definition ID:
280
+ // internal notion of a type.
282
281
pub fn ast_ty_to_ty < AC : AstConv , RS : RegionScope > (
283
282
this : & AC , rscope : & RS , ast_ty : & ast:: Ty ) -> ty:: t {
284
283
0 commit comments