Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
797856cb
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,发现更多精彩内容 >>
提交
797856cb
编写于
6月 18, 2012
作者:
M
Michael Sullivan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use unboxed vecs for string shape glue.
上级
88ec259c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
5 addition
and
12 deletion
+5
-12
src/rt/rust_shape.h
src/rt/rust_shape.h
+1
-0
src/rustc/middle/trans/shape.rs
src/rustc/middle/trans/shape.rs
+1
-9
src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
+1
-1
src/test/run-pass/log-knows-the-names-of-variants.rs
src/test/run-pass/log-knows-the-names-of-variants.rs
+1
-1
src/test/run-pass/log-str.rs
src/test/run-pass/log-str.rs
+1
-1
未找到文件。
src/rt/rust_shape.h
浏览文件 @
797856cb
...
...
@@ -43,6 +43,7 @@ const uint8_t SHAPE_I64 = 7u;
const
uint8_t
SHAPE_F32
=
8u
;
const
uint8_t
SHAPE_F64
=
9u
;
const
uint8_t
SHAPE_BOX
=
10u
;
// FIXME: remove after snapshot (6/18/12)
const
uint8_t
SHAPE_VEC
=
11u
;
const
uint8_t
SHAPE_TAG
=
12u
;
const
uint8_t
SHAPE_STRUCT
=
17u
;
...
...
src/rustc/middle/trans/shape.rs
浏览文件 @
797856cb
...
...
@@ -78,7 +78,6 @@ fn new_nominal_id_hash<T: copy>() -> hashmap<nominal_id, T> {
const
shape_f32
:
u8
=
8u8
;
const
shape_f64
:
u8
=
9u8
;
const
shape_box
:
u8
=
10u8
;
const
shape_vec
:
u8
=
11u8
;
const
shape_enum
:
u8
=
12u8
;
const
shape_struct
:
u8
=
17u8
;
const
shape_box_fn
:
u8
=
18u8
;
...
...
@@ -226,14 +225,7 @@ fn shape_of(ccx: @crate_ctxt, t: ty::t) -> [u8] {
ty
::
ty_float
(
ast
::
ty_f64
)
{
[
shape_f64
]
}
ty
::
ty_estr
(
ty
::
vstore_uniq
)
|
ty
::
ty_str
{
// FIXME: we want to emit this as a unique pointer to an unboxed vec,
// but it doesn't work at the moment, since trans doesn't put
// tydescs in string boxes...
let
mut
s
=
[
shape_vec
];
add_bool
(
s
,
true
);
// type is POD
let
unit_ty
=
ty
::
mk_mach_uint
(
ccx
.tcx
,
ast
::
ty_u8
);
add_substr
(
s
,
shape_of
(
ccx
,
unit_ty
));
s
shape_of
(
ccx
,
tvec
::
expand_boxed_vec_ty
(
ccx
.tcx
,
t
))
}
ty
::
ty_enum
(
did
,
substs
)
{
alt
enum_kind
(
ccx
,
did
)
{
...
...
src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
浏览文件 @
797856cb
...
...
@@ -12,7 +12,7 @@ fn check_log<T>(exp: str, v: T) {
fn
main
()
{
let
x
=
list
::
from_vec
([
a
(
22u
),
b
(
"hi"
)]);
let
exp
=
"@cons(a(22), @cons(b(
\"
hi
\"
), @nil))"
;
let
exp
=
"@cons(a(22), @cons(b(
~
\"
hi
\"
), @nil))"
;
assert
#
fmt
[
"%?"
,
x
]
==
exp
;
check_log
(
exp
,
x
);
}
src/test/run-pass/log-knows-the-names-of-variants.rs
浏览文件 @
797856cb
...
...
@@ -6,6 +6,6 @@ enum foo {
fn
main
()
{
assert
"a(22)"
==
#
fmt
[
"%?"
,
a
(
22u
)];
assert
"b(
\"
hi
\"
)"
==
#
fmt
[
"%?"
,
b
(
"hi"
)];
assert
"b(
~
\"
hi
\"
)"
==
#
fmt
[
"%?"
,
b
(
"hi"
)];
assert
"c"
==
#
fmt
[
"%?"
,
c
];
}
src/test/run-pass/log-str.rs
浏览文件 @
797856cb
fn
main
()
{
assert
"~[1, 2, 3]"
==
sys
::
log_str
([
1
,
2
,
3
]);
assert
#
fmt
[
"%?/%
5?"
,
[
1
,
2
,
3
],
"hi"
]
==
"~[1, 2, 3]/
\"
hi
\"
"
;
assert
#
fmt
[
"%?/%
6?"
,
[
1
,
2
,
3
],
"hi"
]
==
"~[1, 2, 3]/ ~
\"
hi
\"
"
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录