@@ -161,31 +161,30 @@ fn ast_ty_to_ty<AC: ast_conv, RS: region_scope copy>(
161
161
self : AC , rscope : RS , a_seq_ty : @ast:: ty , vst : ty:: vstore ) -> ty:: t {
162
162
163
163
let tcx = self . tcx ( ) ;
164
- let seq_ty = ast_ty_to_ty ( self , rscope, a_seq_ty) ;
165
-
166
- alt ty:: get ( seq_ty) . struct {
167
- ty:: ty_vec ( mt) {
168
- ret ty:: mk_evec ( tcx, mt, vst) ;
169
- }
170
164
171
- // HACK: if we get a ~[], we assume that it was actually a
172
- // [] that got written down, and we throw away the /~...
173
- ty:: ty_evec ( mt, vstore_uniq) {
174
- ret ty:: mk_evec ( tcx, mt, vst) ;
165
+ alt a_seq_ty. node {
166
+ ast:: ty_vec ( mt) {
167
+ ret ty:: mk_evec ( tcx, ast_mt_to_mt ( self , rscope, mt) , vst) ;
175
168
}
176
-
177
- ty:: ty_str {
178
- ret ty:: mk_estr ( tcx, vst) ;
179
- }
180
-
181
- _ {
182
- tcx. sess . span_err (
183
- a_seq_ty. span ,
184
- #fmt[ "bound not allowed on a %s" ,
185
- ty:: ty_sort_str ( tcx, seq_ty) ] ) ;
186
- ret seq_ty;
169
+ ast:: ty_path ( path, id) {
170
+ alt tcx. def_map . find ( id) {
171
+ some ( ast:: def_prim_ty ( ast:: ty_str) ) {
172
+ check_path_args ( tcx, path, NO_TPS | NO_REGIONS ) ;
173
+ ret ty:: mk_estr ( tcx, vst) ;
174
+ }
175
+ _ { }
176
+ }
187
177
}
178
+ _ { }
188
179
}
180
+
181
+ // Get the type, just for the error message
182
+ let seq_ty = ast_ty_to_ty ( self , rscope, a_seq_ty) ;
183
+ tcx. sess . span_err (
184
+ a_seq_ty. span ,
185
+ #fmt[ "bound not allowed on a %s" ,
186
+ ty:: ty_sort_str ( tcx, seq_ty) ] ) ;
187
+ ret seq_ty;
189
188
}
190
189
191
190
fn check_path_args ( tcx : ty:: ctxt ,
0 commit comments