@@ -15,7 +15,6 @@ use util::ppaux::UserString;
15
15
16
16
use syntax:: ast:: * ;
17
17
use syntax:: codemap:: Span ;
18
- use syntax:: print:: pprust:: { ident_to_string} ;
19
18
use syntax:: visit:: Visitor ;
20
19
use syntax:: visit;
21
20
@@ -39,10 +38,6 @@ impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
39
38
fn visit_ty ( & mut self , t : & Ty ) {
40
39
check_ty ( self , t) ;
41
40
}
42
-
43
- fn visit_pat ( & mut self , p : & Pat ) {
44
- check_pat ( self , p) ;
45
- }
46
41
}
47
42
48
43
pub fn check_crate ( tcx : & ty:: ctxt ) {
@@ -239,38 +234,3 @@ pub fn check_freevar_bounds(cx: &Context, fn_span: Span, sp: Span, ty: ty::t,
239
234
} ) ;
240
235
}
241
236
242
- // Ensure that `ty` has a statically known size (i.e., it has the `Sized` bound).
243
- fn check_sized ( tcx : & ty:: ctxt , ty : ty:: t , name : String , sp : Span ) {
244
- if !ty:: type_is_sized ( tcx, ty) {
245
- span_err ! ( tcx. sess, sp, E0151 ,
246
- "variable `{}` has dynamically sized type `{}`" ,
247
- name, ty_to_string( tcx, ty) ) ;
248
- }
249
- }
250
-
251
- // Check that any variables in a pattern have types with statically known size.
252
- fn check_pat ( cx : & mut Context , pat : & Pat ) {
253
- let var_name = match pat. node {
254
- PatWild ( PatWildSingle ) => Some ( "_" . to_string ( ) ) ,
255
- PatIdent ( _, ref path1, _) => Some ( ident_to_string ( & path1. node ) . to_string ( ) ) ,
256
- _ => None
257
- } ;
258
-
259
- match var_name {
260
- Some ( name) => {
261
- let types = cx. tcx . node_types . borrow ( ) ;
262
- let ty = types. find ( & ( pat. id as uint ) ) ;
263
- match ty {
264
- Some ( ty) => {
265
- debug ! ( "kind: checking sized-ness of variable {}: {}" ,
266
- name, ty_to_string( cx. tcx, * ty) ) ;
267
- check_sized ( cx. tcx , * ty, name, pat. span ) ;
268
- }
269
- None => { } // extern fn args
270
- }
271
- }
272
- None => { }
273
- }
274
-
275
- visit:: walk_pat ( cx, pat) ;
276
- }
0 commit comments