Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
be2c9207
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,发现更多精彩内容 >>
提交
be2c9207
编写于
7月 03, 2012
作者:
G
Graydon Hoare
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change crust -> extern.
上级
dc981654
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
56 addition
and
51 deletion
+56
-51
src/libcore/task.rs
src/libcore/task.rs
+2
-2
src/libstd/net_ip.rs
src/libstd/net_ip.rs
+1
-1
src/libstd/net_tcp.rs
src/libstd/net_tcp.rs
+9
-9
src/libstd/timer.rs
src/libstd/timer.rs
+2
-2
src/libstd/uv_global_loop.rs
src/libstd/uv_global_loop.rs
+2
-2
src/libstd/uv_iotask.rs
src/libstd/uv_iotask.rs
+7
-7
src/libstd/uv_ll.rs
src/libstd/uv_ll.rs
+12
-12
src/libsyntax/ast.rs
src/libsyntax/ast.rs
+1
-1
src/rustc/middle/trans/foreign.rs
src/rustc/middle/trans/foreign.rs
+1
-1
src/rustc/middle/typeck/check.rs
src/rustc/middle/typeck/check.rs
+1
-1
src/test/compile-fail/extern-no-call.rs
src/test/compile-fail/extern-no-call.rs
+1
-1
src/test/compile-fail/extern-wrong-value-type.rs
src/test/compile-fail/extern-wrong-value-type.rs
+2
-2
src/test/run-fail/extern-fail.rs
src/test/run-fail/extern-fail.rs
+1
-1
src/test/run-pass/extern-1.rs
src/test/run-pass/extern-1.rs
+5
-0
src/test/run-pass/extern-call-deep.rs
src/test/run-pass/extern-call-deep.rs
+1
-1
src/test/run-pass/extern-call-deep2.rs
src/test/run-pass/extern-call-deep2.rs
+1
-1
src/test/run-pass/extern-call-scrub.rs
src/test/run-pass/extern-call-scrub.rs
+1
-1
src/test/run-pass/extern-call.rs
src/test/run-pass/extern-call.rs
+1
-1
src/test/run-pass/extern-stress.rs
src/test/run-pass/extern-stress.rs
+1
-1
src/test/run-pass/extern-take-value.rs
src/test/run-pass/extern-take-value.rs
+3
-3
src/test/run-pass/extern-yield.rs
src/test/run-pass/extern-yield.rs
+1
-1
未找到文件。
src/libcore/task.rs
浏览文件 @
be2c9207
...
...
@@ -612,7 +612,7 @@ fn new_task_in_new_sched(opts: sched_opts) -> *rust_task {
// Has to be a pointer at outermost layer; the foreign call returns void *.
type
task_local_map
=
@
dvec
::
dvec
<
option
<
task_local_element
>>
;
crust
fn
cleanup_task_local_map
(
map_ptr
:
*
libc
::
c_void
)
unsafe
{
extern
fn
cleanup_task_local_map
(
map_ptr
:
*
libc
::
c_void
)
unsafe
{
assert
!
map_ptr
.is_null
();
// Get and keep the single reference that was created at the beginning.
let
map
:
task_local_map
=
unsafe
::
reinterpret_cast
(
map_ptr
);
...
...
@@ -1250,7 +1250,7 @@ fn my_key(+_x: @str) { }
#[test]
fn
test_tls_crust_automorestack_memorial_bug
()
unsafe
{
// This might result in a stack-canary clobber if the runtime fails to set
// sp_limit to 0 when calling the cleanup
crust
- it might automatically
// sp_limit to 0 when calling the cleanup
extern
- it might automatically
// jump over to the rust stack, which causes next_c_sp to get recorded as
// something within a rust stack segment. Then a subsequent upcall (esp.
// for logging, think vsnprintf) would run on a stack smaller than 1 MB.
...
...
src/libstd/net_ip.rs
浏览文件 @
be2c9207
...
...
@@ -257,7 +257,7 @@ fn try_parse_addr(ip: str) -> result::result<ip_addr,parse_addr_err> {
output_ch
:
comm
::
chan
<
result
::
result
<
[
ip_addr
]
/~
,
ip_get_addr_err
>>
};
crust
fn
get_addr_cb
(
handle
:
*
uv_getaddrinfo_t
,
status
:
libc
::
c_int
,
extern
fn
get_addr_cb
(
handle
:
*
uv_getaddrinfo_t
,
status
:
libc
::
c_int
,
res
:
*
addrinfo
)
unsafe
{
log
(
debug
,
"in get_addr_cb"
);
let
handle_data
=
get_data_for_req
(
handle
)
as
...
...
src/libstd/net_tcp.rs
浏览文件 @
be2c9207
...
...
@@ -1031,13 +1031,13 @@ enum tcp_new_connection {
mut
active
:
bool
};
crust
fn
tcp_lfc_close_cb
(
handle
:
*
uv
::
ll
::
uv_tcp_t
)
unsafe
{
extern
fn
tcp_lfc_close_cb
(
handle
:
*
uv
::
ll
::
uv_tcp_t
)
unsafe
{
let
server_data_ptr
=
uv
::
ll
::
get_data_for_uv_handle
(
handle
)
as
*
tcp_listen_fc_data
;
comm
::
send
((
*
server_data_ptr
)
.stream_closed_ch
,
());
}
crust
fn
tcp_lfc_on_connection_cb
(
handle
:
*
uv
::
ll
::
uv_tcp_t
,
extern
fn
tcp_lfc_on_connection_cb
(
handle
:
*
uv
::
ll
::
uv_tcp_t
,
status
:
libc
::
c_int
)
unsafe
{
let
server_data_ptr
=
uv
::
ll
::
get_data_for_uv_handle
(
handle
)
as
*
tcp_listen_fc_data
;
...
...
@@ -1094,7 +1094,7 @@ fn to_tcp_err() -> tcp_err_data {
}
}
crust
fn
on_tcp_read_cb
(
stream
:
*
uv
::
ll
::
uv_stream_t
,
extern
fn
on_tcp_read_cb
(
stream
:
*
uv
::
ll
::
uv_stream_t
,
nread
:
libc
::
ssize_t
,
++
buf
:
uv
::
ll
::
uv_buf_t
)
unsafe
{
log
(
debug
,
#
fmt
(
"entering on_tcp_read_cb stream: %? nread: %?"
,
...
...
@@ -1128,7 +1128,7 @@ fn to_tcp_err() -> tcp_err_data {
log
(
debug
,
"exiting on_tcp_read_cb"
);
}
crust
fn
on_alloc_cb
(
handle
:
*
libc
::
c_void
,
extern
fn
on_alloc_cb
(
handle
:
*
libc
::
c_void
,
++
suggested_size
:
size_t
)
->
uv
::
ll
::
uv_buf_t
unsafe
{
log
(
debug
,
"tcp read on_alloc_cb!"
);
...
...
@@ -1144,7 +1144,7 @@ fn to_tcp_err() -> tcp_err_data {
closed_ch
:
comm
::
chan
<
()
>
};
crust
fn
tcp_socket_dtor_close_cb
(
handle
:
*
uv
::
ll
::
uv_tcp_t
)
unsafe
{
extern
fn
tcp_socket_dtor_close_cb
(
handle
:
*
uv
::
ll
::
uv_tcp_t
)
unsafe
{
let
data
=
uv
::
ll
::
get_data_for_uv_handle
(
handle
)
as
*
tcp_socket_close_data
;
let
closed_ch
=
(
*
data
)
.closed_ch
;
...
...
@@ -1152,7 +1152,7 @@ fn to_tcp_err() -> tcp_err_data {
log
(
debug
,
"tcp_socket_dtor_close_cb exiting.."
);
}
crust
fn
tcp_write_complete_cb
(
write_req
:
*
uv
::
ll
::
uv_write_t
,
extern
fn
tcp_write_complete_cb
(
write_req
:
*
uv
::
ll
::
uv_write_t
,
status
:
libc
::
c_int
)
unsafe
{
let
write_data_ptr
=
uv
::
ll
::
get_data_for_req
(
write_req
)
as
*
write_req_data
;
...
...
@@ -1178,18 +1178,18 @@ fn to_tcp_err() -> tcp_err_data {
closed_signal_ch
:
comm
::
chan
<
()
>
};
crust
fn
stream_error_close_cb
(
handle
:
*
uv
::
ll
::
uv_tcp_t
)
unsafe
{
extern
fn
stream_error_close_cb
(
handle
:
*
uv
::
ll
::
uv_tcp_t
)
unsafe
{
let
data
=
uv
::
ll
::
get_data_for_uv_handle
(
handle
)
as
*
connect_req_data
;
comm
::
send
((
*
data
)
.closed_signal_ch
,
());
log
(
debug
,
#
fmt
(
"exiting steam_error_close_cb for %?"
,
handle
));
}
crust
fn
tcp_connect_close_cb
(
handle
:
*
uv
::
ll
::
uv_tcp_t
)
unsafe
{
extern
fn
tcp_connect_close_cb
(
handle
:
*
uv
::
ll
::
uv_tcp_t
)
unsafe
{
log
(
debug
,
#
fmt
(
"closed client tcp handle %?"
,
handle
));
}
crust
fn
tcp_connect_on_connect_cb
(
connect_req_ptr
:
*
uv
::
ll
::
uv_connect_t
,
extern
fn
tcp_connect_on_connect_cb
(
connect_req_ptr
:
*
uv
::
ll
::
uv_connect_t
,
status
:
libc
::
c_int
)
unsafe
{
let
conn_data_ptr
=
(
uv
::
ll
::
get_data_for_req
(
connect_req_ptr
)
as
*
connect_req_data
);
...
...
src/libstd/timer.rs
浏览文件 @
be2c9207
...
...
@@ -116,7 +116,7 @@ fn recv_timeout<T: copy send>(iotask: iotask,
}
// INTERNAL API
crust
fn
delayed_send_cb
(
handle
:
*
uv
::
ll
::
uv_timer_t
,
extern
fn
delayed_send_cb
(
handle
:
*
uv
::
ll
::
uv_timer_t
,
status
:
libc
::
c_int
)
unsafe
{
log
(
debug
,
#
fmt
(
"delayed_send_cb handle %? status %?"
,
handle
,
status
));
let
timer_done_ch
=
...
...
@@ -133,7 +133,7 @@ fn recv_timeout<T: copy send>(iotask: iotask,
}
}
crust
fn
delayed_send_close_cb
(
handle
:
*
uv
::
ll
::
uv_timer_t
)
unsafe
{
extern
fn
delayed_send_close_cb
(
handle
:
*
uv
::
ll
::
uv_timer_t
)
unsafe
{
log
(
debug
,
#
fmt
(
"delayed_send_close_cb handle %?"
,
handle
));
let
timer_done_ch
=
*
(
uv
::
ll
::
get_data_for_uv_handle
(
handle
)
as
*
comm
::
chan
<
()
>
);
...
...
src/libstd/uv_global_loop.rs
浏览文件 @
be2c9207
...
...
@@ -116,7 +116,7 @@ fn spawn_loop() -> iotask unsafe {
#[cfg(test)]
mod
test
{
crust
fn
simple_timer_close_cb
(
timer_ptr
:
*
ll
::
uv_timer_t
)
unsafe
{
extern
fn
simple_timer_close_cb
(
timer_ptr
:
*
ll
::
uv_timer_t
)
unsafe
{
let
exit_ch_ptr
=
ll
::
get_data_for_uv_handle
(
timer_ptr
as
*
libc
::
c_void
)
as
*
comm
::
chan
<
bool
>
;
let
exit_ch
=
*
exit_ch_ptr
;
...
...
@@ -124,7 +124,7 @@ mod test {
log
(
debug
,
#
fmt
(
"EXIT_CH_PTR simple_timer_close_cb exit_ch_ptr: %?"
,
exit_ch_ptr
));
}
crust
fn
simple_timer_cb
(
timer_ptr
:
*
ll
::
uv_timer_t
,
extern
fn
simple_timer_cb
(
timer_ptr
:
*
ll
::
uv_timer_t
,
_
status
:
libc
::
c_int
)
unsafe
{
log
(
debug
,
"in simple timer cb"
);
ll
::
timer_stop
(
timer_ptr
);
...
...
src/libstd/uv_iotask.rs
浏览文件 @
be2c9207
...
...
@@ -148,10 +148,10 @@ fn send_msg(iotask: iotask,
}
#[doc
=
"Dispatch all pending messages"
]
crust
fn
wake_up_cb
(
async_handle
:
*
ll
::
uv_async_t
,
extern
fn
wake_up_cb
(
async_handle
:
*
ll
::
uv_async_t
,
status
:
int
)
unsafe
{
log
(
debug
,
#
fmt
(
"wake_up_cb
crust
.. handle: %? status: %?"
,
log
(
debug
,
#
fmt
(
"wake_up_cb
extern
.. handle: %? status: %?"
,
async_handle
,
status
));
let
loop_ptr
=
ll
::
get_loop_for_uv_handle
(
async_handle
);
...
...
@@ -176,7 +176,7 @@ fn begin_teardown(data: *iotask_loop_data) unsafe {
ll
::
close
(
async_handle
as
*
c_void
,
tear_down_close_cb
);
}
crust
fn
tear_down_close_cb
(
handle
:
*
ll
::
uv_async_t
)
unsafe
{
extern
fn
tear_down_close_cb
(
handle
:
*
ll
::
uv_async_t
)
unsafe
{
let
loop_ptr
=
ll
::
get_loop_for_uv_handle
(
handle
);
let
loop_refs
=
ll
::
loop_refcount
(
loop_ptr
);
log
(
debug
,
#
fmt
(
"tear_down_close_cb called, closing handle at %? refs %?"
,
...
...
@@ -186,13 +186,13 @@ fn begin_teardown(data: *iotask_loop_data) unsafe {
#[cfg(test)]
mod
test
{
crust
fn
async_close_cb
(
handle
:
*
ll
::
uv_async_t
)
unsafe
{
extern
fn
async_close_cb
(
handle
:
*
ll
::
uv_async_t
)
unsafe
{
log
(
debug
,
#
fmt
(
"async_close_cb handle %?"
,
handle
));
let
exit_ch
=
(
*
(
ll
::
get_data_for_uv_handle
(
handle
)
as
*
ah_data
))
.exit_ch
;
comm
::
send
(
exit_ch
,
());
}
crust
fn
async_handle_cb
(
handle
:
*
ll
::
uv_async_t
,
status
:
libc
::
c_int
)
extern
fn
async_handle_cb
(
handle
:
*
ll
::
uv_async_t
,
status
:
libc
::
c_int
)
unsafe
{
log
(
debug
,
#
fmt
(
"async_handle_cb handle %? status %?"
,
handle
,
status
));
ll
::
close
(
handle
,
async_close_cb
);
...
...
@@ -231,11 +231,11 @@ unsafe fn spawn_test_loop(exit_ch: comm::chan<()>) -> iotask {
ret
comm
::
recv
(
iotask_port
);
}
crust
fn
lifetime_handle_close
(
handle
:
*
libc
::
c_void
)
unsafe
{
extern
fn
lifetime_handle_close
(
handle
:
*
libc
::
c_void
)
unsafe
{
log
(
debug
,
#
fmt
(
"lifetime_handle_close ptr %?"
,
handle
));
}
crust
fn
lifetime_async_callback
(
handle
:
*
libc
::
c_void
,
extern
fn
lifetime_async_callback
(
handle
:
*
libc
::
c_void
,
status
:
libc
::
c_int
)
{
log
(
debug
,
#
fmt
(
"lifetime_handle_close ptr %? status %?"
,
handle
,
status
));
...
...
src/libstd/uv_ll.rs
浏览文件 @
be2c9207
...
...
@@ -1016,12 +1016,12 @@ enum tcp_read_data {
read_chan
:
*
comm
::
chan
<
str
>
};
crust
fn
after_close_cb
(
handle
:
*
libc
::
c_void
)
{
extern
fn
after_close_cb
(
handle
:
*
libc
::
c_void
)
{
log
(
debug
,
#
fmt
(
"after uv_close! handle ptr: %?"
,
handle
));
}
crust
fn
on_alloc_cb
(
handle
:
*
libc
::
c_void
,
extern
fn
on_alloc_cb
(
handle
:
*
libc
::
c_void
,
++
suggested_size
:
libc
::
size_t
)
->
uv_buf_t
unsafe
{
log
(
debug
,
"on_alloc_cb!"
);
...
...
@@ -1033,7 +1033,7 @@ enum tcp_read_data {
ret
buf_init
(
char_ptr
,
suggested_size
as
uint
);
}
crust
fn
on_read_cb
(
stream
:
*
uv_stream_t
,
extern
fn
on_read_cb
(
stream
:
*
uv_stream_t
,
nread
:
libc
::
ssize_t
,
++
buf
:
uv_buf_t
)
unsafe
{
let
nread
=
nread
as
int
;
...
...
@@ -1067,7 +1067,7 @@ enum tcp_read_data {
log
(
debug
,
"CLIENT exiting on_read_cb"
);
}
crust
fn
on_write_complete_cb
(
write_req
:
*
uv_write_t
,
extern
fn
on_write_complete_cb
(
write_req
:
*
uv_write_t
,
status
:
libc
::
c_int
)
unsafe
{
log
(
debug
,
#
fmt
(
"CLIENT beginning on_write_complete_cb status: %d"
,
status
as
int
));
...
...
@@ -1079,7 +1079,7 @@ enum tcp_read_data {
result
as
int
));
}
crust
fn
on_connect_cb
(
connect_req_ptr
:
*
uv_connect_t
,
extern
fn
on_connect_cb
(
connect_req_ptr
:
*
uv_connect_t
,
status
:
libc
::
c_int
)
unsafe
{
log
(
debug
,
#
fmt
(
"beginning on_connect_cb .. status: %d"
,
status
as
int
));
...
...
@@ -1184,12 +1184,12 @@ fn impl_uv_tcp_request(ip: str, port: int, req_str: str,
}
crust
fn
server_after_close_cb
(
handle
:
*
libc
::
c_void
)
unsafe
{
extern
fn
server_after_close_cb
(
handle
:
*
libc
::
c_void
)
unsafe
{
log
(
debug
,
#
fmt
(
"SERVER server stream closed, should exit.. h: %?"
,
handle
));
}
crust
fn
client_stream_after_close_cb
(
handle
:
*
libc
::
c_void
)
extern
fn
client_stream_after_close_cb
(
handle
:
*
libc
::
c_void
)
unsafe
{
log
(
debug
,
"SERVER: closed client stream, now closing server stream"
);
let
client_data
=
get_data_for_uv_handle
(
...
...
@@ -1199,7 +1199,7 @@ fn impl_uv_tcp_request(ip: str, port: int, req_str: str,
server_after_close_cb
);
}
crust
fn
after_server_resp_write
(
req
:
*
uv_write_t
)
unsafe
{
extern
fn
after_server_resp_write
(
req
:
*
uv_write_t
)
unsafe
{
let
client_stream_ptr
=
get_stream_handle_from_write_req
(
req
);
log
(
debug
,
"SERVER: resp sent... closing client stream"
);
...
...
@@ -1207,7 +1207,7 @@ fn impl_uv_tcp_request(ip: str, port: int, req_str: str,
client_stream_after_close_cb
)
}
crust
fn
on_server_read_cb
(
client_stream_ptr
:
*
uv_stream_t
,
extern
fn
on_server_read_cb
(
client_stream_ptr
:
*
uv_stream_t
,
nread
:
libc
::
ssize_t
,
++
buf
:
uv_buf_t
)
unsafe
{
let
nread
=
nread
as
int
;
...
...
@@ -1268,7 +1268,7 @@ fn impl_uv_tcp_request(ip: str, port: int, req_str: str,
log
(
debug
,
"SERVER exiting on_read_cb"
);
}
crust
fn
server_connection_cb
(
server_stream_ptr
:
extern
fn
server_connection_cb
(
server_stream_ptr
:
*
uv_stream_t
,
status
:
libc
::
c_int
)
unsafe
{
log
(
debug
,
"client connecting!"
);
...
...
@@ -1335,12 +1335,12 @@ fn impl_uv_tcp_request(ip: str, port: int, req_str: str,
continue_chan
:
*
comm
::
chan
<
bool
>
};
crust
fn
async_close_cb
(
handle
:
*
libc
::
c_void
)
{
extern
fn
async_close_cb
(
handle
:
*
libc
::
c_void
)
{
log
(
debug
,
#
fmt
(
"SERVER: closing async cb... h: %?"
,
handle
));
}
crust
fn
continue_async_cb
(
async_handle
:
*
uv_async_t
,
extern
fn
continue_async_cb
(
async_handle
:
*
uv_async_t
,
status
:
libc
::
c_int
)
unsafe
{
// once we're in the body of this callback,
// the tcp server's loop is set up, so we
...
...
src/libsyntax/ast.rs
浏览文件 @
be2c9207
...
...
@@ -563,7 +563,7 @@ enum purity {
pure_fn
,
// declared with "pure fn"
unsafe_fn
,
// declared with "unsafe fn"
impure_fn
,
// declared with "fn"
extern_fn
,
// declared with "
crust
fn"
extern_fn
,
// declared with "
extern
fn"
}
#[auto_serialize]
...
...
src/rustc/middle/trans/foreign.rs
浏览文件 @
be2c9207
...
...
@@ -1009,7 +1009,7 @@ fn build_shim_fn(ccx: @crate_ctxt, path: ast_map::path,
fn
build_args
(
bcx
:
block
,
tys
:
@
c_stack_tys
,
llargbundle
:
ValueRef
)
->
~
[
ValueRef
]
{
let
_
icx
=
bcx
.insn_ctxt
(
"foreign::
crust
::shim::build_args"
);
let
_
icx
=
bcx
.insn_ctxt
(
"foreign::
extern
::shim::build_args"
);
let
mut
llargvals
=
~
[];
let
mut
i
=
0u
;
let
n
=
vec
::
len
(
tys
.arg_tys
);
...
...
src/rustc/middle/typeck/check.rs
浏览文件 @
be2c9207
...
...
@@ -2031,7 +2031,7 @@ fn ty_param_bounds_and_ty_for_def(fcx: @fn_ctxt, sp: span, defn: ast::def) ->
}
}
ast
::
def_fn
(
id
,
ast
::
extern_fn
)
{
//
Crust
functions are just u8 pointers
//
extern
functions are just u8 pointers
ret
{
bounds
:
@~
[],
rp
:
ast
::
rp_none
,
...
...
src/test/compile-fail/
crust
-no-call.rs
→
src/test/compile-fail/
extern
-no-call.rs
浏览文件 @
be2c9207
// error-pattern:expected function or foreign function but found *u8
crust
fn
f
()
{
extern
fn
f
()
{
}
fn
main
()
{
...
...
src/test/compile-fail/
crust
-wrong-value-type.rs
→
src/test/compile-fail/
extern
-wrong-value-type.rs
浏览文件 @
be2c9207
// error-pattern:expected `fn()` but found `*u8`
crust
fn
f
()
{
extern
fn
f
()
{
}
fn
main
()
{
//
Crust
functions are *u8 types
//
extern
functions are *u8 types
let
_
x
:
fn
()
=
f
;
}
\ No newline at end of file
src/test/run-fail/
crust
-fail.rs
→
src/test/run-fail/
extern
-fail.rs
浏览文件 @
be2c9207
...
...
@@ -7,7 +7,7 @@ fn rust_dbg_call(cb: *u8,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
crust
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
extern
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
if
data
==
1u
{
data
}
else
{
...
...
src/test/run-pass/
crust
-1.rs
→
src/test/run-pass/
extern
-1.rs
浏览文件 @
be2c9207
crust
fn
f
()
{
extern
fn
f
()
{
}
fn
main
()
{
...
...
src/test/run-pass/
crust
-call-deep.rs
→
src/test/run-pass/
extern
-call-deep.rs
浏览文件 @
be2c9207
...
...
@@ -3,7 +3,7 @@ fn rust_dbg_call(cb: *u8,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
crust
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
extern
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
if
data
==
1u
{
data
}
else
{
...
...
src/test/run-pass/
crust
-call-deep2.rs
→
src/test/run-pass/
extern
-call-deep2.rs
浏览文件 @
be2c9207
...
...
@@ -3,7 +3,7 @@ fn rust_dbg_call(cb: *u8,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
crust
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
extern
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
if
data
==
1u
{
data
}
else
{
...
...
src/test/run-pass/
crust
-call-scrub.rs
→
src/test/run-pass/
extern
-call-scrub.rs
浏览文件 @
be2c9207
...
...
@@ -7,7 +7,7 @@ fn rust_dbg_call(cb: *u8,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
crust
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
extern
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
if
data
==
1u
{
data
}
else
{
...
...
src/test/run-pass/
crust
-call.rs
→
src/test/run-pass/
extern
-call.rs
浏览文件 @
be2c9207
...
...
@@ -3,7 +3,7 @@ fn rust_dbg_call(cb: *u8,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
crust
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
extern
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
if
data
==
1u
{
data
}
else
{
...
...
src/test/run-pass/
crust
-stress.rs
→
src/test/run-pass/
extern
-stress.rs
浏览文件 @
be2c9207
...
...
@@ -6,7 +6,7 @@ fn rust_dbg_call(cb: *u8,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
crust
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
extern
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
if
data
==
1u
{
data
}
else
{
...
...
src/test/run-pass/
crust
-take-value.rs
→
src/test/run-pass/
extern
-take-value.rs
浏览文件 @
be2c9207
crust
fn
f
()
{
extern
fn
f
()
{
}
crust
fn
g
()
{
extern
fn
g
()
{
}
fn
main
()
{
//
Crust
functions are *u8 types
//
extern
functions are *u8 types
let
a
:
*
u8
=
f
;
let
b
:
*
u8
=
f
;
let
c
:
*
u8
=
g
;
...
...
src/test/run-pass/
crust
-yield.rs
→
src/test/run-pass/
extern
-yield.rs
浏览文件 @
be2c9207
...
...
@@ -3,7 +3,7 @@ fn rust_dbg_call(cb: *u8,
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
;
}
crust
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
extern
fn
cb
(
data
:
libc
::
uintptr_t
)
->
libc
::
uintptr_t
{
if
data
==
1u
{
data
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录