Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
6156bc56
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
6156bc56
编写于
2月 01, 2012
作者:
K
Kevin Cantu
提交者:
Brian Anderson
2月 01, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Propagating unsafe::slice 2
上级
47c57a17
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
14 addition
and
14 deletion
+14
-14
src/comp/back/link.rs
src/comp/back/link.rs
+2
-2
src/comp/middle/debuginfo.rs
src/comp/middle/debuginfo.rs
+2
-2
src/comp/syntax/parse/lexer.rs
src/comp/syntax/parse/lexer.rs
+4
-4
src/libstd/fs.rs
src/libstd/fs.rs
+2
-2
src/libstd/getopts.rs
src/libstd/getopts.rs
+4
-4
未找到文件。
src/comp/back/link.rs
浏览文件 @
6156bc56
...
...
@@ -562,7 +562,7 @@ fn mangle_internal_name_by_seq(ccx: @crate_ctxt, flav: str) -> str {
fn
link_binary
(
sess
:
session
,
obj_filename
:
str
,
out_filename
:
str
,
lm
:
link_meta
)
{
lm
:
link_meta
)
unsafe
{
// Converts a library file name into a gcc -l argument
fn
unlib
(
config
:
@
session
::
config
,
filename
:
str
)
->
str
{
let
rmlib
=
fn
@
(
filename
:
str
)
->
str
{
...
...
@@ -570,7 +570,7 @@ fn unlib(config: @session::config, filename: str) -> str {
(
config
.os
==
session
::
os_linux
||
config
.os
==
session
::
os_freebsd
)
&&
str
::
find
(
filename
,
"lib"
)
==
0
{
ret
str
::
slice
(
filename
,
3u
,
ret
str
::
unsafe
::
slice
(
filename
,
3u
,
str
::
byte_len
(
filename
));
}
else
{
ret
filename
;
}
};
...
...
src/comp/middle/debuginfo.rs
浏览文件 @
6156bc56
...
...
@@ -157,7 +157,7 @@ fn cached_metadata<T: copy>(cache: metadata_cache, mdtag: int,
}
fn
create_compile_unit
(
cx
:
@
crate_ctxt
,
full_path
:
str
)
->
@
metadata
<
compile_unit_md
>
{
->
@
metadata
<
compile_unit_md
>
unsafe
{
let
cache
=
get_cache
(
cx
);
let
tg
=
CompileUnitTag
;
alt
cached_metadata
::
<@
metadata
<
compile_unit_md
>>
(
cache
,
tg
,
...
...
@@ -168,7 +168,7 @@ fn create_compile_unit(cx: @crate_ctxt, full_path: str)
let
work_dir
=
cx
.sess.working_dir
;
let
file_path
=
if
str
::
starts_with
(
full_path
,
work_dir
)
{
str
::
slice
(
full_path
,
str
::
byte_len
(
work_dir
),
str
::
unsafe
::
slice
(
full_path
,
str
::
byte_len
(
work_dir
),
str
::
byte_len
(
full_path
))
}
else
{
full_path
...
...
src/comp/syntax/parse/lexer.rs
浏览文件 @
6156bc56
...
...
@@ -24,10 +24,10 @@
impl
reader
for
reader
{
fn
is_eof
()
->
bool
{
self
.curr
==
-
1
as
char
}
fn
get_str_from
(
start
:
uint
)
->
str
{
fn
get_str_from
(
start
:
uint
)
->
str
unsafe
{
// I'm pretty skeptical about this subtraction. What if there's a
// multi-byte character before the mark?
ret
str
::
slice
(
*
self
.src
,
start
-
1u
,
self
.pos
-
1u
);
ret
str
::
unsafe
::
slice
(
*
self
.src
,
start
-
1u
,
self
.pos
-
1u
);
}
fn
next
()
->
char
{
if
self
.pos
<
self
.len
{
...
...
@@ -579,11 +579,11 @@ fn all_whitespace(s: str, begin: uint, end: uint) -> bool {
ret
true
;
}
fn
trim_whitespace_prefix_and_push_line
(
&
lines
:
[
str
],
s
:
str
,
col
:
uint
)
{
fn
trim_whitespace_prefix_and_push_line
(
&
lines
:
[
str
],
s
:
str
,
col
:
uint
)
unsafe
{
let
s1
;
if
all_whitespace
(
s
,
0u
,
col
)
{
if
col
<
str
::
byte_len
(
s
)
{
s1
=
str
::
slice
(
s
,
col
,
str
::
byte_len
(
s
));
s1
=
str
::
unsafe
::
slice
(
s
,
col
,
str
::
byte_len
(
s
));
}
else
{
s1
=
""
;
}
}
else
{
s1
=
s
;
}
log
(
debug
,
"pushing line: "
+
s1
);
...
...
src/libstd/fs.rs
浏览文件 @
6156bc56
...
...
@@ -63,7 +63,7 @@ fn dirname(p: path) -> path {
the provided path. If an empty path is provided or the path ends
with a path separator then an empty path is returned.
*/
fn
basename
(
p
:
path
)
->
path
{
fn
basename
(
p
:
path
)
->
path
unsafe
{
let
i
:
int
=
str
::
rindex
(
p
,
os_fs
::
path_sep
as
u8
);
if
i
==
-
1
{
i
=
str
::
rindex
(
p
,
os_fs
::
alt_path_sep
as
u8
);
...
...
@@ -71,7 +71,7 @@ fn basename(p: path) -> path {
}
let
len
=
str
::
byte_len
(
p
);
if
i
+
1
as
uint
>=
len
{
ret
p
;
}
ret
str
::
slice
(
p
,
i
+
1
as
uint
,
len
);
ret
str
::
unsafe
::
slice
(
p
,
i
+
1
as
uint
,
len
);
}
...
...
src/libstd/getopts.rs
浏览文件 @
6156bc56
...
...
@@ -209,7 +209,7 @@ fn fail_str(f: fail_) -> str {
<opt_str>, etc. to interrogate results.
err(fail_) - On failure. Use <fail_str> to get an error message.
*/
fn
getopts
(
args
:
[
str
],
opts
:
[
opt
])
->
result
{
fn
getopts
(
args
:
[
str
],
opts
:
[
opt
])
->
result
unsafe
{
let
n_opts
=
vec
::
len
::
<
opt
>
(
opts
);
fn
f
(
_
x
:
uint
)
->
[
optval
]
{
ret
[];
}
let
vals
=
vec
::
init_fn_mut
::
<
[
optval
]
>
(
n_opts
,
f
);
...
...
@@ -229,14 +229,14 @@ fn getopts(args: [str], opts: [opt]) -> result {
let
names
;
let
i_arg
=
option
::
none
::
<
str
>
;
if
cur
[
1
]
==
'-'
as
u8
{
let
tail
=
str
::
slice
(
cur
,
2u
,
curlen
);
let
tail
=
str
::
unsafe
::
slice
(
cur
,
2u
,
curlen
);
let
eq
=
str
::
index
(
tail
,
'='
as
u8
);
if
eq
==
-
1
{
names
=
[
long
(
tail
)];
}
else
{
names
=
[
long
(
str
::
slice
(
tail
,
0u
,
eq
as
uint
))];
names
=
[
long
(
str
::
unsafe
::
slice
(
tail
,
0u
,
eq
as
uint
))];
i_arg
=
option
::
some
::
<
str
>
(
str
::
slice
(
tail
,
option
::
some
::
<
str
>
(
str
::
unsafe
::
slice
(
tail
,
(
eq
as
uint
)
+
1u
,
curlen
-
2u
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录