Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
18db9a29
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,发现更多精彩内容 >>
提交
18db9a29
编写于
4月 16, 2013
作者:
T
Tim Chevalier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustc: One less copy
上级
2a864852
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
14 deletion
+13
-14
src/librustc/back/link.rs
src/librustc/back/link.rs
+2
-2
src/librustc/driver/driver.rs
src/librustc/driver/driver.rs
+4
-4
src/librustc/driver/session.rs
src/librustc/driver/session.rs
+2
-2
src/librustc/rustc.rc
src/librustc/rustc.rc
+5
-6
未找到文件。
src/librustc/back/link.rs
浏览文件 @
18db9a29
...
...
@@ -153,9 +153,9 @@ pub fn exec(sess: Session,
code
:
entry
,
env
:
ptr
::
null
()
};
let
func
:
&
fn
(
++
argv
:
~
[
~
str
])
=
cast
::
transmute
(
closure
);
let
func
:
&
fn
(
++
argv
:
~
[
@
~
str
])
=
cast
::
transmute
(
closure
);
func
(
~
[
/*bad*/
copy
sess
.opts.binary
]);
func
(
~
[
sess
.opts.binary
]);
}
}
}
...
...
src/librustc/driver/driver.rs
浏览文件 @
18db9a29
...
...
@@ -62,7 +62,7 @@ pub fn source_name(input: input) -> ~str {
}
}
pub
fn
default_configuration
(
sess
:
Session
,
+
argv0
:
~
str
,
input
:
input
)
->
pub
fn
default_configuration
(
sess
:
Session
,
argv0
:
@
~
str
,
input
:
input
)
->
ast
::
crate_cfg
{
let
libc
=
match
sess
.targ_cfg.os
{
session
::
os_win32
=>
~
"msvcrt.dll"
,
...
...
@@ -101,7 +101,7 @@ pub fn default_configuration(sess: Session, +argv0: ~str, input: input) ->
mk
(
@~
"target_word_size"
,
@
wordsz
),
mk
(
@~
"target_libc"
,
@
libc
),
// Build bindings.
mk
(
@~
"build_compiler"
,
@
argv0
),
mk
(
@~
"build_compiler"
,
argv0
),
mk
(
@~
"build_input"
,
@
source_name
(
input
))];
}
...
...
@@ -114,7 +114,7 @@ pub fn append_configuration(+cfg: ast::crate_cfg, +name: ~str)
}
}
pub
fn
build_configuration
(
sess
:
Session
,
+
argv0
:
~
str
,
input
:
input
)
->
pub
fn
build_configuration
(
sess
:
Session
,
argv0
:
@
~
str
,
input
:
input
)
->
ast
::
crate_cfg
{
// Combine the configuration requested by the session (command line) with
// some default and generated configuration items
...
...
@@ -523,7 +523,7 @@ pub fn host_triple() -> ~str {
};
}
pub
fn
build_session_options
(
+
binary
:
~
str
,
pub
fn
build_session_options
(
binary
:
@
~
str
,
matches
:
&
getopts
::
Matches
,
demitter
:
diagnostic
::
Emitter
)
->
@
session
::
options
{
...
...
src/librustc/driver/session.rs
浏览文件 @
18db9a29
...
...
@@ -131,7 +131,7 @@ pub struct options {
// will be added to the crate AST node. This should not be used for
// anything except building the full crate config prior to parsing.
cfg
:
ast
::
crate_cfg
,
binary
:
~
str
,
binary
:
@
~
str
,
test
:
bool
,
parse_only
:
bool
,
no_trans
:
bool
,
...
...
@@ -303,7 +303,7 @@ pub fn basic_options() -> @options {
maybe_sysroot
:
None
,
target_triple
:
host_triple
(),
cfg
:
~
[],
binary
:
~
"rustc"
,
binary
:
@
~
"rustc"
,
test
:
false
,
parse_only
:
false
,
no_trans
:
false
,
...
...
src/librustc/rustc.rc
浏览文件 @
18db9a29
...
...
@@ -206,9 +206,9 @@ pub fn run_compiler(args: &~[~str], demitter: diagnostic::Emitter) {
::core::logging::console_off();
let mut args = /*bad*/copy *args;
let binary = args.shift();
let binary =
@
args.shift();
if args.is_empty() { usage(binary); return; }
if args.is_empty() { usage(
*
binary); return; }
let matches =
&match getopts::groups::getopts(args, optgroups()) {
...
...
@@ -219,7 +219,7 @@ pub fn run_compiler(args: &~[~str], demitter: diagnostic::Emitter) {
};
if opt_present(matches, ~"h") || opt_present(matches, ~"help") {
usage(binary);
usage(
*
binary);
return;
}
...
...
@@ -236,7 +236,7 @@ pub fn run_compiler(args: &~[~str], demitter: diagnostic::Emitter) {
}
if opt_present(matches, ~"v") || opt_present(matches, ~"version") {
version(binary);
version(
*
binary);
return;
}
let input = match vec::len(matches.free) {
...
...
@@ -253,8 +253,7 @@ pub fn run_compiler(args: &~[~str], demitter: diagnostic::Emitter) {
_ => early_error(demitter, ~"multiple input filenames provided")
};
// XXX: Bad copy.
let sopts = build_session_options(copy binary, matches, demitter);
let sopts = build_session_options(binary, matches, demitter);
let sess = build_session(sopts, demitter);
let odir = getopts::opt_maybe_str(matches, ~"out-dir");
let odir = odir.map(|o| Path(*o));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录