Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
a239c0ed
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,发现更多精彩内容 >>
提交
a239c0ed
编写于
10月 25, 2013
作者:
J
Joshua Yanovski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make addl_lib_search_paths a HashSet (Closes #7718).
上级
950add4e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
42 addition
and
23 deletion
+42
-23
src/librustc/driver/driver.rs
src/librustc/driver/driver.rs
+3
-1
src/librustc/driver/session.rs
src/librustc/driver/session.rs
+5
-5
src/librustc/metadata/filesearch.rs
src/librustc/metadata/filesearch.rs
+2
-2
src/librustdoc/core.rs
src/librustdoc/core.rs
+3
-3
src/librustdoc/rustdoc.rs
src/librustdoc/rustdoc.rs
+1
-1
src/librustpkg/context.rs
src/librustpkg/context.rs
+7
-5
src/librustpkg/rustpkg.rs
src/librustpkg/rustpkg.rs
+3
-1
src/librustpkg/util.rs
src/librustpkg/util.rs
+1
-5
src/test/run-pass/duplicated-external-mods.rs
src/test/run-pass/duplicated-external-mods.rs
+17
-0
未找到文件。
src/librustc/driver/driver.rs
浏览文件 @
a239c0ed
...
...
@@ -757,7 +757,9 @@ fn set_llvm_debug() {
let
statik
=
debugging_opts
&
session
::
statik
!=
0
;
let
addl_lib_search_paths
=
matches
.opt_strs
(
"L"
)
.map
(|
s
|
Path
::
new
(
s
.as_slice
()));
let
addl_lib_search_paths
=
matches
.opt_strs
(
"L"
)
.map
(|
s
|
{
Path
::
new
(
s
.as_slice
())
})
.move_iter
()
.collect
();
let
linker
=
matches
.opt_str
(
"linker"
);
let
linker_args
=
matches
.opt_strs
(
"link-args"
)
.flat_map
(
|
a
|
{
a
.split_iter
(
' '
)
.map
(|
arg
|
arg
.to_owned
())
.collect
()
...
...
src/librustc/driver/session.rs
浏览文件 @
a239c0ed
...
...
@@ -29,7 +29,7 @@
use
syntax
;
use
std
::
int
;
use
std
::
hashmap
::
HashMap
;
use
std
::
hashmap
::
{
HashMap
,
HashSet
}
;
#[deriving(Eq)]
pub
enum
Os
{
OsWin32
,
OsMacos
,
OsLinux
,
OsAndroid
,
OsFreebsd
,
}
...
...
@@ -158,9 +158,9 @@ pub struct options {
save_temps
:
bool
,
jit
:
bool
,
output_type
:
back
::
link
::
output_type
,
addl_lib_search_paths
:
@
mut
~
[
Path
]
,
// This is mutable for rustpkg, which
// updates search paths based on the
// parsed code
addl_lib_search_paths
:
@
mut
HashSet
<
Path
>
,
// This is mutable for rustpkg, which
// updates search paths based on the
// parsed code
linker
:
Option
<~
str
>
,
linker_args
:
~
[
~
str
],
maybe_sysroot
:
Option
<@
Path
>
,
...
...
@@ -366,7 +366,7 @@ pub fn basic_options() -> @options {
save_temps
:
false
,
jit
:
false
,
output_type
:
link
::
output_type_exe
,
addl_lib_search_paths
:
@
mut
~
[]
,
addl_lib_search_paths
:
@
mut
HashSet
::
new
()
,
linker
:
None
,
linker_args
:
~
[],
maybe_sysroot
:
None
,
...
...
src/librustc/metadata/filesearch.rs
浏览文件 @
a239c0ed
...
...
@@ -40,11 +40,11 @@ pub trait FileSearch {
pub
fn
mk_filesearch
(
maybe_sysroot
:
&
Option
<@
Path
>
,
target_triple
:
&
str
,
addl_lib_search_paths
:
@
mut
~
[
Path
]
)
addl_lib_search_paths
:
@
mut
HashSet
<
Path
>
)
->
@
FileSearch
{
struct
FileSearchImpl
{
sysroot
:
@
Path
,
addl_lib_search_paths
:
@
mut
~
[
Path
]
,
addl_lib_search_paths
:
@
mut
HashSet
<
Path
>
,
target_triple
:
~
str
}
impl
FileSearch
for
FileSearchImpl
{
...
...
src/librustdoc/core.rs
浏览文件 @
a239c0ed
...
...
@@ -20,7 +20,7 @@
use
std
::
os
;
use
std
::
local_data
;
use
std
::
hashmap
::
HashMap
;
use
std
::
hashmap
::
{
HashMap
,
HashSet
}
;
use
visit_ast
::
RustdocVisitor
;
use
clean
;
...
...
@@ -39,7 +39,7 @@ pub struct CrateAnalysis {
/// Parses, resolves, and typechecks the given crate
fn
get_ast_and_resolve
(
cpath
:
&
Path
,
libs
:
~
[
Path
]
)
->
(
DocContext
,
CrateAnalysis
)
{
libs
:
HashSet
<
Path
>
)
->
(
DocContext
,
CrateAnalysis
)
{
use
syntax
::
codemap
::
dummy_spanned
;
use
rustc
::
driver
::
driver
::{
file_input
,
build_configuration
,
phase_1_parse_input
,
...
...
@@ -89,7 +89,7 @@ fn get_ast_and_resolve(cpath: &Path,
CrateAnalysis
{
reexports
:
reexports
,
exported_items
:
exported_items
});
}
pub
fn
run_core
(
libs
:
~
[
Path
]
,
path
:
&
Path
)
->
(
clean
::
Crate
,
CrateAnalysis
)
{
pub
fn
run_core
(
libs
:
HashSet
<
Path
>
,
path
:
&
Path
)
->
(
clean
::
Crate
,
CrateAnalysis
)
{
let
(
ctxt
,
analysis
)
=
get_ast_and_resolve
(
path
,
libs
);
let
ctxt
=
@
ctxt
;
debug!
(
"defmap:"
);
...
...
src/librustdoc/rustdoc.rs
浏览文件 @
a239c0ed
...
...
@@ -198,7 +198,7 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
info!
(
"starting to run rustc"
);
let
(
crate
,
analysis
)
=
do
std
::
task
::
try
{
let
cr
=
cr
.take
();
core
::
run_core
(
libs
.take
(),
&
cr
)
core
::
run_core
(
libs
.take
()
.move_iter
()
.collect
()
,
&
cr
)
}
.unwrap
();
info!
(
"finished with rustc"
);
local_data
::
set
(
analysiskey
,
analysis
);
...
...
src/librustpkg/context.rs
浏览文件 @
a239c0ed
...
...
@@ -10,10 +10,12 @@
// Context data structure used by rustpkg
use
std
::
os
;
use
extra
::
workcache
;
use
rustc
::
driver
::
session
::{
OptLevel
,
No
};
use
std
::
hashmap
::
HashSet
;
use
std
::
os
;
#[deriving(Clone)]
pub
struct
Context
{
// Config strings that the user passed in with --cfg
...
...
@@ -60,7 +62,7 @@ pub fn add_library_path(&mut self, p: Path) {
self
.context
.add_library_path
(
p
);
}
pub
fn
additional_library_paths
(
&
self
)
->
~
[
Path
]
{
pub
fn
additional_library_paths
(
&
self
)
->
HashSet
<
Path
>
{
self
.context.rustc_flags.additional_library_paths
.clone
()
}
}
...
...
@@ -96,7 +98,7 @@ pub struct RustcFlags {
target_cpu
:
Option
<~
str
>
,
// Additional library directories, which get passed with the -L flag
// This can't be set with a rustpkg flag, only from package scripts
additional_library_paths
:
~
[
Path
]
,
additional_library_paths
:
HashSet
<
Path
>
,
// Any -Z features
experimental_features
:
Option
<~
[
~
str
]
>
}
...
...
@@ -163,7 +165,7 @@ pub fn compile_upto(&self) -> StopBefore {
}
pub
fn
add_library_path
(
&
mut
self
,
p
:
Path
)
{
self
.rustc_flags.additional_library_paths
.
push
(
p
);
self
.rustc_flags.additional_library_paths
.
insert
(
p
);
}
}
...
...
@@ -227,7 +229,7 @@ pub fn default() -> RustcFlags {
save_temps
:
false
,
target
:
None
,
target_cpu
:
None
,
additional_library_paths
:
~
[]
,
additional_library_paths
:
HashSet
::
new
()
,
experimental_features
:
None
}
}
...
...
src/librustpkg/rustpkg.rs
浏览文件 @
a239c0ed
...
...
@@ -25,6 +25,7 @@
extern
mod
syntax
;
use
std
::{
os
,
result
,
run
,
str
,
task
};
use
std
::
hashmap
::
HashSet
;
pub
use
std
::
path
::
Path
;
use
extra
::
workcache
;
...
...
@@ -840,7 +841,8 @@ pub fn main_args(args: &[~str]) -> int {
save_temps
:
save_temps
,
target
:
target
,
target_cpu
:
target_cpu
,
additional_library_paths
:
~
[],
// No way to set this from the rustpkg command line
additional_library_paths
:
HashSet
::
new
(),
// No way to set this from the rustpkg command line
experimental_features
:
experimental_features
};
...
...
src/librustpkg/util.rs
浏览文件 @
a239c0ed
...
...
@@ -285,11 +285,7 @@ pub fn compile_input(context: &BuildContext,
debug!
(
"a dependency: {}"
,
p
.display
());
// Pass the directory containing a dependency
// as an additional lib search path
if
!
addl_lib_search_paths
.contains
(
&
p
)
{
// Might be inefficient, but this set probably
// won't get too large -- tjc
addl_lib_search_paths
.push
(
p
);
}
addl_lib_search_paths
.insert
(
p
);
});
// Inject the link attributes so we get the right package name and version
...
...
src/test/run-pass/duplicated-external-mods.rs
0 → 100644
浏览文件 @
a239c0ed
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-fast
// aux-build:anon-extern-mod-cross-crate-1.rs
// aux-build:anon-extern-mod-cross-crate-1.rs
extern
mod
anonexternmod
;
pub
fn
main
()
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录