librustc: Fix silly bug in AST conversion for const vstores. rs=bugfix

Means that we'll need another snapshot to rid the language of `[const T]`.
This commit is contained in:
Patrick Walton 2013-03-04 17:05:42 -08:00
parent 6d4ed5283c
commit c4075492ad
2 changed files with 8 additions and 1 deletions

View File

@ -214,7 +214,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + Durable>(
let mut mt = ast_mt_to_mt(self, rscope, mt);
if a_seq_ty.mutbl == ast::m_mutbl ||
a_seq_ty.mutbl == ast::m_const {
mt = ty::mt { ty: mt.ty, mutbl: ast::m_mutbl };
mt = ty::mt { ty: mt.ty, mutbl: a_seq_ty.mutbl };
}
return ty::mk_evec(tcx, mt, vst);
}

View File

@ -0,0 +1,7 @@
fn f(_: &const [int]) {}
fn main() {
let v = [ 1, 2, 3 ];
f(v);
}