mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
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:
parent
6d4ed5283c
commit
c4075492ad
@ -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);
|
let mut mt = ast_mt_to_mt(self, rscope, mt);
|
||||||
if a_seq_ty.mutbl == ast::m_mutbl ||
|
if a_seq_ty.mutbl == ast::m_mutbl ||
|
||||||
a_seq_ty.mutbl == ast::m_const {
|
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);
|
return ty::mk_evec(tcx, mt, vst);
|
||||||
}
|
}
|
||||||
|
7
src/test/run-pass/const-vec-syntax.rs
Normal file
7
src/test/run-pass/const-vec-syntax.rs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fn f(_: &const [int]) {}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let v = [ 1, 2, 3 ];
|
||||||
|
f(v);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user