Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
4fc36182
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4fc36182
编写于
8月 18, 2011
作者:
B
Brian Anderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change ast::ty_ivec, ty::ty_ivec to ty_vec
上级
504ec8b0
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
47 addition
and
47 deletion
+47
-47
src/comp/front/test.rs
src/comp/front/test.rs
+2
-2
src/comp/metadata/tyencode.rs
src/comp/metadata/tyencode.rs
+1
-1
src/comp/middle/alias.rs
src/comp/middle/alias.rs
+2
-2
src/comp/middle/gc.rs
src/comp/middle/gc.rs
+1
-1
src/comp/middle/shape.rs
src/comp/middle/shape.rs
+1
-1
src/comp/middle/trans.rs
src/comp/middle/trans.rs
+9
-9
src/comp/middle/ty.rs
src/comp/middle/ty.rs
+20
-20
src/comp/middle/typeck.rs
src/comp/middle/typeck.rs
+4
-4
src/comp/syntax/ast.rs
src/comp/syntax/ast.rs
+1
-1
src/comp/syntax/parse/parser.rs
src/comp/syntax/parse/parser.rs
+1
-1
src/comp/syntax/print/pprust.rs
src/comp/syntax/print/pprust.rs
+1
-1
src/comp/syntax/untyped_ast.rs
src/comp/syntax/untyped_ast.rs
+2
-2
src/comp/syntax/visit.rs
src/comp/syntax/visit.rs
+1
-1
src/comp/util/ppaux.rs
src/comp/util/ppaux.rs
+1
-1
未找到文件。
src/comp/front/test.rs
浏览文件 @
4fc36182
...
...
@@ -224,7 +224,7 @@ fn mk_test_desc_ivec_ty(cx: &test_ctxt) -> @ast::ty {
let
ivec_mt
:
ast
::
mt
=
{
ty
:
@
test_desc_ty
,
mut
:
ast
::
imm
};
ret
@
nospan
(
ast
::
ty_
i
vec
(
ivec_mt
));
ret
@
nospan
(
ast
::
ty_vec
(
ivec_mt
));
}
fn
mk_test_desc_vec
(
cx
:
&
test_ctxt
)
->
@
ast
::
expr
{
...
...
@@ -286,7 +286,7 @@ fn mk_test_desc_rec(cx: &test_ctxt, test: test) -> @ast::expr {
fn
mk_main
(
cx
:
&
test_ctxt
)
->
@
ast
::
item
{
let
args_mt
:
ast
::
mt
=
{
ty
:
@
nospan
(
ast
::
ty_str
),
mut
:
ast
::
imm
};
let
args_ty
:
ast
::
ty
=
nospan
(
ast
::
ty_
i
vec
(
args_mt
));
let
args_ty
:
ast
::
ty
=
nospan
(
ast
::
ty_vec
(
args_mt
));
let
args_arg
:
ast
::
arg
=
{
mode
:
ast
::
val
,
ty
:
@
args_ty
,
ident
:
"args"
,
id
:
cx
.next_node_id
()};
...
...
src/comp/metadata/tyencode.rs
浏览文件 @
4fc36182
...
...
@@ -128,7 +128,7 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
ty
::
ty_box
(
mt
)
{
w
.write_char
(
'@'
);
enc_mt
(
w
,
cx
,
mt
);
}
ty
::
ty_uniq
(
t
)
{
w
.write_char
(
'~'
);
enc_ty
(
w
,
cx
,
t
);
}
ty
::
ty_ptr
(
mt
)
{
w
.write_char
(
'*'
);
enc_mt
(
w
,
cx
,
mt
);
}
ty
::
ty_
i
vec
(
mt
)
{
w
.write_char
(
'I'
);
enc_mt
(
w
,
cx
,
mt
);
}
ty
::
ty_vec
(
mt
)
{
w
.write_char
(
'I'
);
enc_mt
(
w
,
cx
,
mt
);
}
ty
::
ty_rec
(
fields
)
{
w
.write_str
(
"R["
);
for
field
:
ty
::
field
in
fields
{
...
...
src/comp/middle/alias.rs
浏览文件 @
4fc36182
...
...
@@ -364,7 +364,7 @@ fn check_for(cx: &ctx, local: &@ast::local, seq: &@ast::expr, blk: &ast::blk,
// If this is a mutable vector, don't allow it to be touched.
let
seq_t
=
ty
::
expr_ty
(
cx
.tcx
,
seq
);
alt
ty
::
struct
(
cx
.tcx
,
seq_t
)
{
ty
::
ty_
i
vec
(
mt
)
{
ty
::
ty_vec
(
mt
)
{
if
mt
.mut
!=
ast
::
imm
{
unsafe
=
~
[
seq_t
];
}
}
ty
::
ty_str
.
|
ty
::
ty_istr
.
{
/* no-op */
}
...
...
@@ -584,7 +584,7 @@ fn maybe_auto_unbox(cx: &ctx, t: ty::t) -> {t: ty::t, ds: [deref]} {
ast
::
expr_index
(
base
,
_
)
{
let
auto_unbox
=
maybe_auto_unbox
(
cx
,
ty
::
expr_ty
(
cx
.tcx
,
base
));
alt
ty
::
struct
(
cx
.tcx
,
auto_unbox
.t
)
{
ty
::
ty_
i
vec
(
mt
)
{
ty
::
ty_vec
(
mt
)
{
ds
+=
~
[
@
{
mut
:
mt
.mut
!=
ast
::
imm
,
kind
:
index
,
...
...
src/comp/middle/gc.rs
浏览文件 @
4fc36182
...
...
@@ -127,7 +127,7 @@ fn type_is_gc_relevant(cx: &ty::ctxt, ty: &ty::t) -> bool {
ret
false
;
}
ty
::
ty_
i
vec
(
tm
)
{
ret
type_is_gc_relevant
(
cx
,
tm
.ty
);
}
ty
::
ty_vec
(
tm
)
{
ret
type_is_gc_relevant
(
cx
,
tm
.ty
);
}
ty
::
ty_constr
(
sub
,
_
)
{
ret
type_is_gc_relevant
(
cx
,
sub
);
}
ty
::
ty_str
.
|
ty
::
ty_box
(
_
)
|
ty
::
ty_uniq
(
_
)
|
...
...
src/comp/middle/shape.rs
浏览文件 @
4fc36182
...
...
@@ -343,7 +343,7 @@ fn shape_of(ccx : &@crate_ctxt, t : ty::t) -> [u8] {
s
+=
~
[
shape_uniq
];
add_substr
(
s
,
shape_of
(
ccx
,
subt
));
}
ty
::
ty_
i
vec
(
mt
)
{
ty
::
ty_vec
(
mt
)
{
s
+=
~
[
shape_ivec
];
add_bool
(
s
,
ty
::
type_is_pod
(
ccx
.tcx
,
mt
.ty
));
add_size_hint
(
ccx
,
s
,
mt
.ty
);
...
...
src/comp/middle/trans.rs
浏览文件 @
4fc36182
...
...
@@ -214,7 +214,7 @@ fn type_of_inner(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> TypeRef {
ty
::
ty_tag
(
did
,
_
)
{
llty
=
type_of_tag
(
cx
,
sp
,
did
,
t
);
}
ty
::
ty_box
(
mt
)
{
llty
=
T_ptr
(
T_box
(
type_of_inner
(
cx
,
sp
,
mt
.ty
)));
}
ty
::
ty_uniq
(
t
)
{
llty
=
T_ptr
(
type_of_inner
(
cx
,
sp
,
t
));
}
ty
::
ty_
i
vec
(
mt
)
{
ty
::
ty_vec
(
mt
)
{
if
ty
::
type_has_dynamic_size
(
cx
.tcx
,
mt
.ty
)
{
llty
=
T_opaque_ivec
();
}
else
{
llty
=
T_ivec
(
type_of_inner
(
cx
,
sp
,
mt
.ty
));
}
...
...
@@ -629,7 +629,7 @@ fn align_elements(cx: &@block_ctxt, elts: &[ty::t]) -> result {
}
else
{
max_size_val
};
ret
rslt
(
bcx
,
total_size
);
}
ty
::
ty_
i
vec
(
mt
)
{
ty
::
ty_vec
(
mt
)
{
let
rs
=
size_of
(
cx
,
mt
.ty
);
let
bcx
=
rs
.bcx
;
let
llunitsz
=
rs
.val
;
...
...
@@ -661,7 +661,7 @@ fn dynamic_align_of(cx: &@block_ctxt, t: &ty::t) -> result {
ty
::
ty_tag
(
_
,
_
)
{
ret
rslt
(
cx
,
C_int
(
1
));
// FIXME: stub
}
ty
::
ty_
i
vec
(
tm
)
{
ty
::
ty_vec
(
tm
)
{
let
rs
=
align_of
(
cx
,
tm
.ty
);
let
bcx
=
rs
.bcx
;
let
llunitalign
=
rs
.val
;
...
...
@@ -1419,7 +1419,7 @@ fn make_drop_glue(cx: &@block_ctxt, v0: ValueRef, t: &ty::t) {
let
rs
=
alt
ty
::
struct
(
ccx
.tcx
,
t
)
{
ty
::
ty_str
.
{
decr_refcnt_maybe_free
(
cx
,
v0
,
v0
,
t
)
}
ty
::
ty_
i
vec
(
tm
)
{
ty
::
ty_vec
(
tm
)
{
let
v1
;
if
ty
::
type_has_dynamic_size
(
ccx
.tcx
,
tm
.ty
)
{
v1
=
cx
.build
.PointerCast
(
v0
,
T_ptr
(
T_opaque_ivec
()));
...
...
@@ -1866,7 +1866,7 @@ fn iter_variant(cx: @block_ctxt, a_tup: ValueRef,
cx
.build
.GEP
(
av
,
~
[
C_int
(
0
),
C_int
(
abi
::
obj_field_box
)]);
ret
iter_boxpp
(
cx
,
box_cell_a
,
f
);
}
ty
::
ty_
i
vec
(
unit_tm
)
{
ret
iter_ivec
(
cx
,
av
,
unit_tm
.ty
,
f
);
}
ty
::
ty_vec
(
unit_tm
)
{
ret
iter_ivec
(
cx
,
av
,
unit_tm
.ty
,
f
);
}
ty
::
ty_istr
.
{
let
unit_ty
=
ty
::
mk_mach
(
bcx_tcx
(
cx
),
ast
::
ty_u8
);
ret
iter_ivec
(
cx
,
av
,
unit_ty
,
f
);
...
...
@@ -1973,7 +1973,7 @@ fn iter_sequence_body(cx: @block_ctxt, v: ValueRef, elt_ty: &ty::t,
let
et
=
ty
::
mk_mach
(
bcx_tcx
(
cx
),
ast
::
ty_u8
);
ret
iter_sequence_body
(
cx
,
v
,
et
,
f
,
true
,
false
);
}
ty
::
ty_
i
vec
(
elt
)
{
ty
::
ty_vec
(
elt
)
{
ret
iter_sequence_body
(
cx
,
v
,
elt
.ty
,
f
,
false
,
true
);
}
ty
::
ty_istr
.
{
...
...
@@ -2257,7 +2257,7 @@ fn memmove_ty(cx: &@block_ctxt, dst: ValueRef, src: ValueRef, t: &ty::t) ->
fn
duplicate_heap_parts_if_necessary
(
cx
:
&@
block_ctxt
,
vptr
:
ValueRef
,
typ
:
ty
::
t
)
->
result
{
alt
ty
::
struct
(
bcx_tcx
(
cx
),
typ
)
{
ty
::
ty_
i
vec
(
tm
)
{
ret
ivec
::
duplicate_heap_part
(
cx
,
vptr
,
tm
.ty
);
}
ty
::
ty_vec
(
tm
)
{
ret
ivec
::
duplicate_heap_part
(
cx
,
vptr
,
tm
.ty
);
}
ty
::
ty_istr
.
{
ret
ivec
::
duplicate_heap_part
(
cx
,
vptr
,
ty
::
mk_mach
(
bcx_tcx
(
cx
),
ast
::
ty_u8
));
...
...
@@ -2798,7 +2798,7 @@ fn trans_append(cx: &@block_ctxt, t: &ty::t, orig_lhs: ValueRef,
let
llunitty
=
type_of_or_i8
(
cx
,
unit_ty
);
alt
ty
::
struct
(
bcx_tcx
(
cx
),
t
)
{
ty
::
ty_istr
.
{
}
ty
::
ty_
i
vec
(
_
)
{
}
ty
::
ty_vec
(
_
)
{
}
_
{
bcx_tcx
(
cx
)
.sess
.bug
(
"non-istr/ivec in trans_append"
);
}
}
...
...
@@ -4769,7 +4769,7 @@ fn trans_ivec(bcx: @block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
let
typ
=
node_id_type
(
bcx_ccx
(
bcx
),
id
);
let
unit_ty
;
alt
ty
::
struct
(
bcx_tcx
(
bcx
),
typ
)
{
ty
::
ty_
i
vec
(
mt
)
{
unit_ty
=
mt
.ty
;
}
ty
::
ty_vec
(
mt
)
{
unit_ty
=
mt
.ty
;
}
_
{
bcx_ccx
(
bcx
)
.sess
.bug
(
"non-ivec type in trans_ivec"
);
}
}
let
llunitty
=
type_of_or_i8
(
bcx
,
unit_ty
);
...
...
src/comp/middle/ty.rs
浏览文件 @
4fc36182
...
...
@@ -129,7 +129,7 @@
export
ty_fn_ret
;
export
ty_int
;
export
ty_istr
;
export
ty_
i
vec
;
export
ty_vec
;
export
ty_machine
;
export
ty_native
;
export
ty_nil
;
...
...
@@ -261,7 +261,7 @@ fn method_ty_to_fn_ty(cx: &ctxt, m: method) -> t {
ty_tag
(
def_id
,
[
t
]);
ty_box
(
mt
);
ty_uniq
(
t
);
ty_
i
vec
(
mt
);
ty_vec
(
mt
);
ty_ptr
(
mt
);
ty_rec
([
field
]);
ty_fn
(
ast
::
proto
,
[
arg
],
t
,
controlflow
,
[
@
constr
]);
...
...
@@ -462,7 +462,7 @@ fn derive_flags_sig(cx: &ctxt, has_params: &mutable bool,
}
ty_box
(
m
)
{
derive_flags_mt
(
cx
,
has_params
,
has_vars
,
m
);
}
ty_uniq
(
tt
)
{
derive_flags_t
(
cx
,
has_params
,
has_vars
,
tt
);
}
ty_
i
vec
(
m
)
{
derive_flags_mt
(
cx
,
has_params
,
has_vars
,
m
);
}
ty_vec
(
m
)
{
derive_flags_mt
(
cx
,
has_params
,
has_vars
,
m
);
}
ty_ptr
(
m
)
{
derive_flags_mt
(
cx
,
has_params
,
has_vars
,
m
);
}
ty_rec
(
flds
)
{
for
f
:
field
in
flds
{
...
...
@@ -563,7 +563,7 @@ fn mk_mut_ptr(cx: &ctxt, ty: &t) -> t {
ret
mk_ptr
(
cx
,
{
ty
:
ty
,
mut
:
ast
::
mut
});
}
fn
mk_ivec
(
cx
:
&
ctxt
,
tm
:
&
mt
)
->
t
{
ret
gen_ty
(
cx
,
ty_
i
vec
(
tm
));
}
fn
mk_ivec
(
cx
:
&
ctxt
,
tm
:
&
mt
)
->
t
{
ret
gen_ty
(
cx
,
ty_vec
(
tm
));
}
fn
mk_rec
(
cx
:
&
ctxt
,
fs
:
&
[
field
])
->
t
{
ret
gen_ty
(
cx
,
ty_rec
(
fs
));
}
...
...
@@ -634,7 +634,7 @@ fn walk_ty(cx: &ctxt, walker: ty_walk, ty: t) {
ty_type
.
{
/* no-op */
}
ty_native
(
_
)
{
/* no-op */
}
ty_box
(
tm
)
{
walk_ty
(
cx
,
walker
,
tm
.ty
);
}
ty_
i
vec
(
tm
)
{
walk_ty
(
cx
,
walker
,
tm
.ty
);
}
ty_vec
(
tm
)
{
walk_ty
(
cx
,
walker
,
tm
.ty
);
}
ty_ptr
(
tm
)
{
walk_ty
(
cx
,
walker
,
tm
.ty
);
}
ty_tag
(
tid
,
subtys
)
{
for
subty
:
t
in
subtys
{
walk_ty
(
cx
,
walker
,
subty
);
}
...
...
@@ -708,7 +708,7 @@ fn fold_ty(cx: &ctxt, fld: fold_mode, ty_0: t) -> t {
ty_ptr
(
tm
)
{
ty
=
mk_ptr
(
cx
,
{
ty
:
fold_ty
(
cx
,
fld
,
tm
.ty
),
mut
:
tm
.mut
});
}
ty_
i
vec
(
tm
)
{
ty_vec
(
tm
)
{
ty
=
mk_ivec
(
cx
,
{
ty
:
fold_ty
(
cx
,
fld
,
tm
.ty
),
mut
:
tm
.mut
});
}
ty_tag
(
tid
,
subtys
)
{
...
...
@@ -828,7 +828,7 @@ fn type_is_structural(cx: &ctxt, ty: &t) -> bool {
ty_fn
(
_
,
_
,
_
,
_
,
_
)
{
ret
true
;
}
ty_obj
(
_
)
{
ret
true
;
}
ty_res
(
_
,
_
,
_
)
{
ret
true
;
}
ty_
i
vec
(
_
)
{
ret
true
;
}
ty_vec
(
_
)
{
ret
true
;
}
ty_istr
.
{
ret
true
;
}
_
{
ret
false
;
}
}
...
...
@@ -846,7 +846,7 @@ fn type_is_sequence(cx: &ctxt, ty: &t) -> bool {
alt
struct
(
cx
,
ty
)
{
ty_str
.
{
ret
true
;
}
ty_istr
.
{
ret
true
;
}
ty_
i
vec
(
_
)
{
ret
true
;
}
ty_vec
(
_
)
{
ret
true
;
}
_
{
ret
false
;
}
}
}
...
...
@@ -863,7 +863,7 @@ fn sequence_is_interior(cx: &ctxt, ty: &t) -> bool {
alt
struct
(
cx
,
ty
)
{
ty
::
ty_str
.
{
ret
false
;
}
ty
::
ty_
i
vec
(
_
)
{
ret
true
;
}
ty
::
ty_vec
(
_
)
{
ret
true
;
}
ty
::
ty_istr
.
{
ret
true
;
}
_
{
cx
.sess
.bug
(
"sequence_is_interior called on non-sequence type"
);
}
}
...
...
@@ -873,7 +873,7 @@ fn sequence_element_type(cx: &ctxt, ty: &t) -> t {
alt
struct
(
cx
,
ty
)
{
ty_str
.
{
ret
mk_mach
(
cx
,
ast
::
ty_u8
);
}
ty_istr
.
{
ret
mk_mach
(
cx
,
ast
::
ty_u8
);
}
ty_
i
vec
(
mt
)
{
ret
mt
.ty
;
}
ty_vec
(
mt
)
{
ret
mt
.ty
;
}
_
{
cx
.sess
.bug
(
"sequence_element_type called on non-sequence value"
);
}
}
}
...
...
@@ -1053,7 +1053,7 @@ fn type_kind(cx: &ctxt, ty: &t) -> ast::kind {
// Pointers and unique boxes / vecs raise pinned to shared,
// otherwise pass through their pointee kind.
ty_ptr
(
tm
)
|
ty_
i
vec
(
tm
)
{
ty_ptr
(
tm
)
|
ty_vec
(
tm
)
{
let
k
=
type_kind
(
cx
,
tm
.ty
);
if
k
==
ast
::
kind_pinned
{
k
=
ast
::
kind_shared
}
result
=
kind
::
lower_kind
(
result
,
k
);
...
...
@@ -1134,7 +1134,7 @@ fn type_has_dynamic_size(cx: &ctxt, ty: &t) -> bool {
ret
false
;
}
ty_box
(
_
)
{
ret
false
;
}
ty_
i
vec
(
mt
)
{
ret
type_has_dynamic_size
(
cx
,
mt
.ty
);
}
ty_vec
(
mt
)
{
ret
type_has_dynamic_size
(
cx
,
mt
.ty
);
}
ty_ptr
(
_
)
{
ret
false
;
}
ty_rec
(
fields
)
{
let
i
=
0u
;
...
...
@@ -1226,7 +1226,7 @@ fn type_owns_heap_mem(cx: &ctxt, ty: &t) -> bool {
let
result
=
false
;
alt
struct
(
cx
,
ty
)
{
ty_
i
vec
(
_
)
{
result
=
true
;
}
ty_vec
(
_
)
{
result
=
true
;
}
ty_istr
.
{
result
=
true
;
}
...
...
@@ -1303,7 +1303,7 @@ fn type_is_pod(cx : &ctxt, ty : &t) -> bool {
}
// Boxed types
ty_str
.
|
ty_istr
.
|
ty_box
(
_
)
|
ty_
i
vec
(
_
)
|
ty_str
.
|
ty_istr
.
|
ty_box
(
_
)
|
ty_vec
(
_
)
|
ty_fn
(
_
,
_
,
_
,
_
,
_
)
|
ty_native_fn
(
_
,
_
,
_
)
|
ty_obj
(
_
)
{
result
=
false
;
}
// Structural types
...
...
@@ -1466,7 +1466,7 @@ fn hash_fn(id: uint, args: &[arg], rty: &t) -> uint {
ret
h
;
}
ty_box
(
mt
)
{
ret
hash_subty
(
19u
,
mt
.ty
);
}
ty_
i
vec
(
mt
)
{
ret
hash_subty
(
21u
,
mt
.ty
);
}
ty_vec
(
mt
)
{
ret
hash_subty
(
21u
,
mt
.ty
);
}
ty_rec
(
fields
)
{
let
h
=
26u
;
for
f
:
field
in
fields
{
h
+=
h
<<
5u
+
hash_ty
(
f
.mt.ty
);
}
...
...
@@ -1627,8 +1627,8 @@ fn equal_def(did_a: &ast::def_id, did_b: &ast::def_id) -> bool {
ty_box
(
mt_a
)
{
alt
b
{
ty_box
(
mt_b
)
{
ret
equal_mt
(
mt_a
,
mt_b
);
}
_
{
ret
false
;
}
}
}
ty_
i
vec
(
mt_a
)
{
alt
b
{
ty_
i
vec
(
mt_b
)
{
ret
equal_mt
(
mt_a
,
mt_b
);
}
_
{
ret
false
;
}
}
ty_vec
(
mt_a
)
{
alt
b
{
ty_vec
(
mt_b
)
{
ret
equal_mt
(
mt_a
,
mt_b
);
}
_
{
ret
false
;
}
}
}
ty_ptr
(
mt_a
)
{
alt
b
{
ty_ptr
(
mt_b
)
{
ret
equal_mt
(
mt_a
,
mt_b
);
}
_
{
ret
false
;
}
}
...
...
@@ -2475,9 +2475,9 @@ fn unify_step(cx: &@ctxt, expected: &t, actual: &t) -> result {
_
{
ret
ures_err
(
terr_mismatch
);
}
}
}
ty
::
ty_
i
vec
(
expected_mt
)
{
ty
::
ty_vec
(
expected_mt
)
{
alt
struct
(
cx
.tcx
,
actual
)
{
ty
::
ty_
i
vec
(
actual_mt
)
{
ty
::
ty_vec
(
actual_mt
)
{
let
mut
;
alt
unify_mut
(
expected_mt
.mut
,
actual_mt
.mut
)
{
none
.
{
ret
ures_err
(
terr_vec_mutability
);
}
...
...
@@ -3008,7 +3008,7 @@ fn tycat(cx: &ctxt, ty: t) -> int {
ty_ptr
(
_
)
{
tycat_int
}
ty_str
.
{
tycat_str
}
ty_istr
.
{
tycat_str
}
ty_
i
vec
(
_
)
{
tycat_vec
}
ty_vec
(
_
)
{
tycat_vec
}
ty_rec
(
_
)
{
tycat_struct
}
ty_tup
(
_
)
{
tycat_struct
}
ty_tag
(
_
,
_
)
{
tycat_struct
}
...
...
src/comp/middle/typeck.rs
浏览文件 @
4fc36182
...
...
@@ -324,7 +324,7 @@ fn instantiate(tcx: &ty::ctxt, sp: &span, getter: &ty_getter,
ast
::
ty_box
(
mt
)
{
typ
=
ty
::
mk_box
(
tcx
,
ast_mt_to_mt
(
tcx
,
getter
,
mt
));
}
ast
::
ty_
i
vec
(
mt
)
{
ast
::
ty_vec
(
mt
)
{
typ
=
ty
::
mk_ivec
(
tcx
,
ast_mt_to_mt
(
tcx
,
getter
,
mt
));
}
ast
::
ty_ptr
(
mt
)
{
...
...
@@ -1987,7 +1987,7 @@ fn check_binop_type_compat(fcx: &@fn_ctxt, span: span, ty: ty::t,
let
ety
=
expr_ty
(
tcx
,
seq
);
alt
structure_of
(
fcx
,
expr
.span
,
ety
)
{
ty
::
ty_str
.
{
elt_ty
=
ty
::
mk_mach
(
tcx
,
ast
::
ty_u8
);
}
ty
::
ty_
i
vec
(
vec_elt_ty
)
{
elt_ty
=
vec_elt_ty
.ty
;
}
ty
::
ty_vec
(
vec_elt_ty
)
{
elt_ty
=
vec_elt_ty
.ty
;
}
ty
::
ty_istr
.
{
elt_ty
=
ty
::
mk_mach
(
tcx
,
ast
::
ty_u8
);
}
_
{
tcx
.sess
.span_fatal
...
...
@@ -2291,7 +2291,7 @@ fn get_node(f: &spanned<field>) -> field { f.node }
+
ty_to_str
(
tcx
,
idx_t
));
}
alt
structure_of
(
fcx
,
expr
.span
,
base_t
)
{
ty
::
ty_
i
vec
(
mt
)
{
write
::
ty_only_fixup
(
fcx
,
id
,
mt
.ty
);
}
ty
::
ty_vec
(
mt
)
{
write
::
ty_only_fixup
(
fcx
,
id
,
mt
.ty
);
}
ty
::
ty_str
.
{
let
typ
=
ty
::
mk_mach
(
tcx
,
ast
::
ty_u8
);
write
::
ty_only_fixup
(
fcx
,
id
,
typ
);
...
...
@@ -2653,7 +2653,7 @@ fn check_item(ccx: @crate_ctxt, it: &@ast::item) {
fn
arg_is_argv_ty
(
tcx
:
&
ty
::
ctxt
,
a
:
&
ty
::
arg
)
->
bool
{
alt
ty
::
struct
(
tcx
,
a
.ty
)
{
ty
::
ty_
i
vec
(
mt
)
{
ty
::
ty_vec
(
mt
)
{
if
mt
.mut
!=
ast
::
imm
{
ret
false
;
}
alt
ty
::
struct
(
tcx
,
mt
.ty
)
{
ty
::
ty_str
.
{
ret
true
;
}
...
...
src/comp/syntax/ast.rs
浏览文件 @
4fc36182
...
...
@@ -439,7 +439,7 @@ fn ty_mach_to_str(tm: ty_mach) -> str {
ty_str
;
ty_istr
;
// interior string
ty_box
(
mt
);
ty_
i
vec
(
mt
);
// interior vector
ty_vec
(
mt
);
// interior vector
ty_ptr
(
mt
);
ty_task
;
ty_port
(
@
ty
);
...
...
src/comp/syntax/parse/parser.rs
浏览文件 @
4fc36182
...
...
@@ -570,7 +570,7 @@ fn parse_ty(p: &parser, colons_before_params: bool) -> @ast::ty {
}
}
else
if
(
p
.peek
()
==
token
::
LBRACKET
)
{
expect
(
p
,
token
::
LBRACKET
);
t
=
ast
::
ty_
i
vec
(
parse_mt
(
p
));
t
=
ast
::
ty_vec
(
parse_mt
(
p
));
hi
=
p
.get_hi_pos
();
expect
(
p
,
token
::
RBRACKET
);
}
else
if
(
eat_word
(
p
,
"fn"
))
{
...
...
src/comp/syntax/print/pprust.rs
浏览文件 @
4fc36182
...
...
@@ -284,7 +284,7 @@ fn print_type(s: &ps, ty: &@ast::ty) {
ast
::
ty_str
.
{
word
(
s
.s
,
"str"
);
}
ast
::
ty_istr
.
{
word
(
s
.s
,
"istr"
);
}
ast
::
ty_box
(
mt
)
{
word
(
s
.s
,
"@"
);
print_mt
(
s
,
mt
);
}
ast
::
ty_
i
vec
(
mt
)
{
ast
::
ty_vec
(
mt
)
{
word
(
s
.s
,
"["
);
alt
mt
.mut
{
ast
::
mut
.
{
word_space
(
s
,
"mutable"
);
}
...
...
src/comp/syntax/untyped_ast.rs
浏览文件 @
4fc36182
...
...
@@ -174,7 +174,7 @@
n_ty_istr
;
n_ty_box
;
n_ty_vec
;
n_ty_
i
vec
;
n_ty_vec
;
n_ty_ptr
;
n_ty_task
;
n_ty_port
;
...
...
@@ -620,7 +620,7 @@ fn cv_ty(ctx: &ctx, ut: &@ast_node) -> @ty {
[
ty_istr
,
n_ty_istr
,
[]],
[
ty_box
,
n_ty_box
,
[
cv_mt
]],
[
ty_vec
,
n_ty_vec
,
[
cv_mt
]],
[
ty_
ivec
,
n_ty_i
vec
,
[
cv_mt
]],
[
ty_
vec
,
n_ty_
vec
,
[
cv_mt
]],
[
ty_ptr
,
n_ty_ptr
,
[
cv_mt
]],
[
ty_task
,
n_ty_task
,
[]],
[
ty_port
,
n_ty_port
,
[
cv_ty
]],
...
...
src/comp/syntax/visit.rs
浏览文件 @
4fc36182
...
...
@@ -124,7 +124,7 @@ fn visit_ty<E>(t: &@ty, e: &E, v: &vt<E>) {
ty_str
.
{
/* no-op */
}
ty_istr
.
{
/* no-op */
}
ty_box
(
mt
)
{
v
.visit_ty
(
mt
.ty
,
e
,
v
);
}
ty_
i
vec
(
mt
)
{
v
.visit_ty
(
mt
.ty
,
e
,
v
);
}
ty_vec
(
mt
)
{
v
.visit_ty
(
mt
.ty
,
e
,
v
);
}
ty_ptr
(
mt
)
{
v
.visit_ty
(
mt
.ty
,
e
,
v
);
}
ty_port
(
t
)
{
v
.visit_ty
(
t
,
e
,
v
);
}
ty_chan
(
t
)
{
v
.visit_ty
(
t
,
e
,
v
);
}
...
...
src/comp/util/ppaux.rs
浏览文件 @
4fc36182
...
...
@@ -92,7 +92,7 @@ fn mt_to_str(cx: &ctxt, m: &mt) -> str {
ty_istr
.
{
s
+=
"istr"
;
}
ty_box
(
tm
)
{
s
+=
"@"
+
mt_to_str
(
cx
,
tm
);
}
ty_uniq
(
t
)
{
s
+=
"~"
+
ty_to_str
(
cx
,
t
);
}
ty_
i
vec
(
tm
)
{
s
+=
"["
+
mt_to_str
(
cx
,
tm
)
+
"]"
;
}
ty_vec
(
tm
)
{
s
+=
"["
+
mt_to_str
(
cx
,
tm
)
+
"]"
;
}
ty_type
.
{
s
+=
"type"
;
}
ty_rec
(
elems
)
{
let
strs
:
[
str
]
=
~
[];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录