Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
4e1ce014
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,发现更多精彩内容 >>
提交
4e1ce014
编写于
11月 07, 2012
作者:
G
Graydon Hoare
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup: convert some remaining #foo invocations to foo! form.
上级
2b93ab5a
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
22 addition
and
34 deletion
+22
-34
src/librustc/front/intrinsic.rs
src/librustc/front/intrinsic.rs
+1
-1
src/librustc/middle/liveness.rs
src/librustc/middle/liveness.rs
+1
-1
src/librustc/middle/ty.rs
src/librustc/middle/ty.rs
+1
-1
src/librustc/middle/typeck/check.rs
src/librustc/middle/typeck/check.rs
+1
-1
src/libstd/serialization.rs
src/libstd/serialization.rs
+1
-1
src/libsyntax/ext/source_util.rs
src/libsyntax/ext/source_util.rs
+3
-3
src/test/bench/core-std.rs
src/test/bench/core-std.rs
+4
-6
src/test/bench/msgsend-ring-pipes.rs
src/test/bench/msgsend-ring-pipes.rs
+3
-6
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
+1
-1
src/test/bench/shootout-k-nucleotide.rs
src/test/bench/shootout-k-nucleotide.rs
+1
-1
src/test/compile-fail/issue-2823.rs
src/test/compile-fail/issue-2823.rs
+2
-2
src/test/run-pass/issue-2904.rs
src/test/run-pass/issue-2904.rs
+1
-1
src/test/run-pass/macro-2.rs
src/test/run-pass/macro-2.rs
+0
-7
src/test/run-pass/syntax-extension-shell.rs
src/test/run-pass/syntax-extension-shell.rs
+1
-1
src/test/run-pass/syntax-extension-source-utils.rs
src/test/run-pass/syntax-extension-source-utils.rs
+1
-1
未找到文件。
src/librustc/front/intrinsic.rs
浏览文件 @
4e1ce014
// NB: this file is
#include_str
'ed into the compiler, re-parsed
// NB: this file is
include_str!
'ed into the compiler, re-parsed
// and injected into each crate the compiler builds. Keep it small.
mod
intrinsic
{
...
...
src/librustc/middle/liveness.rs
浏览文件 @
4e1ce014
...
...
@@ -1536,7 +1536,7 @@ fn check_expr(expr: @expr, &&self: @Liveness, vt: vt<@Liveness>) {
// Probably a bad error message (what's an rvalue?)
// but I can't think of anything better
self
.tcx.sess
.span_err
(
arg_expr
.span
,
#
fmt
(
"Move mode argument must be an rvalue: try
\
fmt!
(
"Move mode argument must be an rvalue: try
\
(move %s) instead"
,
expr_to_str
(
*
arg_expr
,
self
.tcx.sess
.intr
())));
}
...
...
src/librustc/middle/ty.rs
浏览文件 @
4e1ce014
...
...
@@ -1533,7 +1533,7 @@ fn do_subst(cx: ctxt,
cx
,
typ
,
|
r
|
match
r
{
re_bound
(
br_self
)
=>
substs
.self_r
.expect
(
#
fmt
(
"ty::subst:
\
fmt!
(
"ty::subst:
\
Reference to self region when given substs with no
\
self region, ty = %s"
,
ty_to_str
(
cx
,
typ
))),
_
=>
r
...
...
src/librustc/middle/typeck/check.rs
浏览文件 @
4e1ce014
...
...
@@ -2430,7 +2430,7 @@ fn do_check(ccx: @crate_ctxt, sp: span, vs: ~[ast::variant],
}
Err
(
err
)
=>
{
ccx
.tcx.sess
.span_err
(
e
.span
,
#
fmt
(
"expected constant: %s"
,
err
));
fmt!
(
"expected constant: %s"
,
err
));
}
}
...
...
src/libstd/serialization.rs
浏览文件 @
4e1ce014
...
...
@@ -376,7 +376,7 @@ pub impl<D: Deserializer, T: Deserializable<D>> Option<T>: Deserializable<D> {
match
i
{
0
=>
None
,
1
=>
Some
(
d
.read_enum_variant_arg
(
0u
,
||
deserialize
(
d
))),
_
=>
fail
(
#
fmt
(
"Bad variant for option: %u"
,
i
))
_
=>
fail
(
fmt!
(
"Bad variant for option: %u"
,
i
))
}
}
}
...
...
src/libsyntax/ext/source_util.rs
浏览文件 @
4e1ce014
...
...
@@ -57,7 +57,7 @@ fn expand_mod(cx: ext_ctxt, sp: span, arg: ast::mac_arg, _body: ast::mac_body)
fn
expand_include
(
cx
:
ext_ctxt
,
sp
:
span
,
arg
:
ast
::
mac_arg
,
_
body
:
ast
::
mac_body
)
->
@
ast
::
expr
{
let
args
=
get_mac_args
(
cx
,
sp
,
arg
,
1u
,
option
::
Some
(
1u
),
~
"include"
);
let
file
=
expr_to_str
(
cx
,
args
[
0
],
~
"
#include_str
requires a string"
);
let
file
=
expr_to_str
(
cx
,
args
[
0
],
~
"
include_str!
requires a string"
);
let
p
=
parse
::
new_parser_from_file
(
cx
.parse_sess
(),
cx
.cfg
(),
&
res_rel_file
(
cx
,
sp
,
&
Path
(
file
)),
parse
::
parser
::
SOURCE_FILE
);
...
...
@@ -68,7 +68,7 @@ fn expand_include_str(cx: ext_ctxt, sp: codemap::span, arg: ast::mac_arg,
_
body
:
ast
::
mac_body
)
->
@
ast
::
expr
{
let
args
=
get_mac_args
(
cx
,
sp
,
arg
,
1u
,
option
::
Some
(
1u
),
~
"include_str"
);
let
file
=
expr_to_str
(
cx
,
args
[
0
],
~
"
#include_str
requires a string"
);
let
file
=
expr_to_str
(
cx
,
args
[
0
],
~
"
include_str!
requires a string"
);
let
res
=
io
::
read_whole_file_str
(
&
res_rel_file
(
cx
,
sp
,
&
Path
(
file
)));
match
res
{
...
...
@@ -85,7 +85,7 @@ fn expand_include_bin(cx: ext_ctxt, sp: codemap::span, arg: ast::mac_arg,
_
body
:
ast
::
mac_body
)
->
@
ast
::
expr
{
let
args
=
get_mac_args
(
cx
,
sp
,
arg
,
1u
,
option
::
Some
(
1u
),
~
"include_bin"
);
let
file
=
expr_to_str
(
cx
,
args
[
0
],
~
"
#include_bin
requires a string"
);
let
file
=
expr_to_str
(
cx
,
args
[
0
],
~
"
include_bin!
requires a string"
);
match
io
::
read_whole_file
(
&
res_rel_file
(
cx
,
sp
,
&
Path
(
file
)))
{
result
::
Ok
(
src
)
=>
{
...
...
src/test/bench/core-std.rs
浏览文件 @
4e1ce014
...
...
@@ -8,14 +8,12 @@
use
io
::{
Reader
,
ReaderUtil
};
macro_rules!
bench
(
(
$id:ident
)
=>
(
maybe_run_test
(
argv
,
stringify!
(
$id
),
$id
))
)
fn
main
()
{
let
argv
=
os
::
args
();
#
macro
[
[
#
bench
[
id
],
maybe_run_test
(
argv
,
#
stringify
(
id
),
id
)
]
];
let
tests
=
vec
::
view
(
argv
,
1
,
argv
.len
());
bench!
(
shift_push
);
...
...
src/test/bench/msgsend-ring-pipes.rs
浏览文件 @
4e1ce014
...
...
@@ -18,12 +18,9 @@
}
)
fn
macros
()
{
#
macro
[
[
#
move_out
[
x
],
unsafe
{
let
y
=
move
*
ptr
::
addr_of
(
&
x
);
move
y
}]
];
}
macro_rules!
move_out
(
(
$x:expr
)
=>
{
unsafe
{
let
y
=
move
*
ptr
::
addr_of
(
&
$x
);
move
y
}
}
)
fn
thread_ring
(
i
:
uint
,
count
:
uint
,
...
...
src/test/bench/shootout-k-nucleotide-pipes.rs
浏览文件 @
4e1ce014
...
...
@@ -132,7 +132,7 @@ fn main() {
let
args
=
os
::
args
();
let
rdr
=
if
os
::
getenv
(
~
"RUST_BENCH"
)
.is_some
()
{
// FIXME: Using this compile-time env variable is a crummy way to
// get to this massive data set, but
#include_bin
chokes on it (#2598)
// get to this massive data set, but
include_bin!
chokes on it (#2598)
let
path
=
Path
(
env!
(
"CFG_SRC_DIR"
))
.push_rel
(
&
Path
(
"src/test/bench/shootout-k-nucleotide.data"
));
result
::
get
(
&
io
::
file_reader
(
&
path
))
...
...
src/test/bench/shootout-k-nucleotide.rs
浏览文件 @
4e1ce014
...
...
@@ -129,7 +129,7 @@ fn main() {
let
args
=
os
::
args
();
let
rdr
=
if
os
::
getenv
(
~
"RUST_BENCH"
)
.is_some
()
{
// FIXME: Using this compile-time env variable is a crummy way to
// get to this massive data set, but
#include_bin
chokes on it (#2598)
// get to this massive data set, but
include_bin!
chokes on it (#2598)
let
path
=
Path
(
env!
(
"CFG_SRC_DIR"
))
.push_rel
(
&
Path
(
"src/test/bench/shootout-k-nucleotide.data"
));
result
::
get
(
&
io
::
file_reader
(
&
path
))
...
...
src/test/compile-fail/issue-2823.rs
浏览文件 @
4e1ce014
struct
C
{
x
:
int
,
drop
{
#
error
(
"dropping: %?"
,
self
.x
);
error!
(
"dropping: %?"
,
self
.x
);
}
}
fn
main
()
{
let
c
=
C
{
x
:
2
};
let
d
=
copy
c
;
//~ ERROR copying a noncopyable value
#
error
(
"%?"
,
d
.x
);
error!
(
"%?"
,
d
.x
);
}
\ No newline at end of file
src/test/run-pass/issue-2904.rs
浏览文件 @
4e1ce014
...
...
@@ -71,7 +71,7 @@ fn trivial_to_str() {
#[test]
fn
read_simple_board
()
{
let
s
=
#
include_str
(
"./maps/contest1.map"
);
let
s
=
include_str!
(
"./maps/contest1.map"
);
io
::
with_str_reader
(
s
,
read_board_grid
)
}
}
...
...
src/test/run-pass/macro-2.rs
浏览文件 @
4e1ce014
// xfail-pretty - token trees can't pretty print
fn
main
()
{
#
macro
[[
#
mylambda
[
x
,
body
],
{
fn
f
(
x
:
int
)
->
int
{
return
body
;
}
f
}]];
assert
(
mylambda!
(
y
,
y
*
2
)(
8
)
==
16
);
macro_rules!
mylambda_tt
(
(
$x:ident
,
$body:expr
)
=>
{
...
...
src/test/run-pass/syntax-extension-shell.rs
浏览文件 @
4e1ce014
// xfail-test
fn
main
()
{
auto
s
=
#
shell
{
uname
-
a
}
;
let
s
=
shell!
(
uname
-
a
)
;
log
(
debug
,
s
);
}
src/test/run-pass/syntax-extension-source-utils.rs
浏览文件 @
4e1ce014
// This test is brittle!
// xfail-pretty - the pretty tests lose path information, breaking
#include
// xfail-pretty - the pretty tests lose path information, breaking
include!
#[legacy_exports]
;
mod
m1
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录