@@ -282,6 +282,12 @@ pub static NO_TPS: uint = 2;
282282pub fn ast_ty_to_ty < AC : AstConv , RS : RegionScope > (
283283 this : & AC , rscope : & RS , ast_ty : & ast:: Ty ) -> ty:: t {
284284
285+ fn ast_ty_to_mt < AC : AstConv , RS : RegionScope > (
286+ this : & AC , rscope : & RS , ty : & ast:: Ty ) -> ty:: mt {
287+
288+ ty:: mt { ty : ast_ty_to_ty ( this, rscope, ty) , mutbl : ast:: MutImmutable }
289+ }
290+
285291 fn ast_mt_to_mt < AC : AstConv , RS : RegionScope > (
286292 this : & AC , rscope : & RS , mt : & ast:: mt ) -> ty:: mt {
287293
@@ -303,8 +309,8 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
303309 debug ! ( "mk_pointer(vst={:?})" , vst) ;
304310
305311 match a_seq_ty. ty . node {
306- ast:: ty_vec( ref mt ) => {
307- let mut mt = ast_mt_to_mt ( this, rscope, mt ) ;
312+ ast:: ty_vec( ty ) => {
313+ let mut mt = ast_ty_to_mt ( this, rscope, ty ) ;
308314 if a_seq_ty. mutbl == ast:: MutMutable {
309315 mt = ty:: mt { ty : mt. ty , mutbl : a_seq_ty. mutbl } ;
310316 }
@@ -394,14 +400,15 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
394400 mk_pointer ( this, rscope, mt, ty:: vstore_box,
395401 |tmt| ty:: mk_box ( tcx, tmt) )
396402 }
397- ast:: ty_uniq( ref mt) => {
398- mk_pointer ( this, rscope, mt, ty:: vstore_uniq,
403+ ast:: ty_uniq( ty) => {
404+ let mt = ast:: mt { ty : ty, mutbl : ast:: MutImmutable } ;
405+ mk_pointer ( this, rscope, & mt, ty:: vstore_uniq,
399406 |tmt| ty:: mk_uniq ( tcx, tmt) )
400407 }
401- ast:: ty_vec( ref mt ) => {
408+ ast:: ty_vec( ty ) => {
402409 tcx. sess . span_err ( ast_ty. span , "bare `[]` is not a type" ) ;
403410 // return /something/ so they can at least get more errors
404- ty:: mk_evec ( tcx, ast_mt_to_mt ( this, rscope, mt ) , ty:: vstore_uniq)
411+ ty:: mk_evec ( tcx, ast_ty_to_mt ( this, rscope, ty ) , ty:: vstore_uniq)
405412 }
406413 ast:: ty_ptr( ref mt) => {
407414 ty:: mk_ptr ( tcx, ast_mt_to_mt ( this, rscope, mt) )
@@ -532,15 +539,15 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
532539 }
533540 }
534541 }
535- ast:: ty_fixed_length_vec( ref a_mt , e) => {
542+ ast:: ty_fixed_length_vec( ty , e) => {
536543 match const_eval:: eval_const_expr_partial ( & tcx, e) {
537544 Ok ( ref r) => {
538545 match * r {
539546 const_eval:: const_int( i) =>
540- ty:: mk_evec ( tcx, ast_mt_to_mt ( this, rscope, a_mt ) ,
547+ ty:: mk_evec ( tcx, ast_ty_to_mt ( this, rscope, ty ) ,
541548 ty:: vstore_fixed ( i as uint ) ) ,
542549 const_eval:: const_uint( i) =>
543- ty:: mk_evec ( tcx, ast_mt_to_mt ( this, rscope, a_mt ) ,
550+ ty:: mk_evec ( tcx, ast_ty_to_mt ( this, rscope, ty ) ,
544551 ty:: vstore_fixed ( i as uint ) ) ,
545552 _ => {
546553 tcx. sess . span_fatal (
0 commit comments