Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
7c166f54
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,发现更多精彩内容 >>
提交
7c166f54
编写于
8月 22, 2018
作者:
E
Eduard-Mihai Burtescu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move Cargo.{toml,lock} to the repository root directory.
上级
6612100d
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
70 addition
and
52 deletion
+70
-52
CONTRIBUTING.md
CONTRIBUTING.md
+1
-6
Cargo.lock
Cargo.lock
+0
-0
Cargo.toml
Cargo.toml
+30
-30
src/bootstrap/bootstrap.py
src/bootstrap/bootstrap.py
+1
-1
src/bootstrap/dist.rs
src/bootstrap/dist.rs
+4
-2
src/bootstrap/test.rs
src/bootstrap/test.rs
+1
-0
src/bootstrap/tool.rs
src/bootstrap/tool.rs
+24
-4
src/test/rustdoc-ui/failed-doctest-output.stdout
src/test/rustdoc-ui/failed-doctest-output.stdout
+2
-2
src/tools/tidy/src/deps.rs
src/tools/tidy/src/deps.rs
+4
-4
src/tools/tidy/src/extdeps.rs
src/tools/tidy/src/extdeps.rs
+2
-2
src/tools/tidy/src/lib.rs
src/tools/tidy/src/lib.rs
+1
-1
未找到文件。
CONTRIBUTING.md
浏览文件 @
7c166f54
...
...
@@ -494,16 +494,11 @@ the version in `Cargo.lock`, so the build can no longer continue.
To resolve this, we need to update
`Cargo.lock`
. Luckily, cargo provides a
command to do this easily.
First, go into the
`src/`
directory since that is where
`Cargo.toml`
is in
the rust repository. Then run,
`cargo update -p rustfmt-nightly`
to solve
the problem.
```
$ cd src
$ cargo update -p rustfmt-nightly
```
This should change the version listed in
`
src/
Cargo.lock`
to the new version you updated
This should change the version listed in
`Cargo.lock`
to the new version you updated
the submodule to. Running
`./x.py build`
should work now.
## Writing Documentation
...
...
src/
Cargo.lock
→
Cargo.lock
浏览文件 @
7c166f54
文件已移动
src/
Cargo.toml
→
Cargo.toml
浏览文件 @
7c166f54
[workspace]
members
=
[
"bootstrap"
,
"rustc"
,
"libstd"
,
"libtest"
,
"librustc_codegen_llvm"
,
"tools/cargotest"
,
"tools/clippy"
,
"tools/compiletest"
,
"tools/error_index_generator"
,
"tools/linkchecker"
,
"tools/rustbook"
,
"tools/unstable-book-gen"
,
"tools/tidy"
,
"tools/build-manifest"
,
"tools/remote-test-client"
,
"tools/remote-test-server"
,
"tools/rust-installer"
,
"tools/cargo"
,
"tools/rustdoc"
,
"tools/rls"
,
"tools/rustfmt"
,
"tools/miri"
,
"tools/rustdoc-themes"
,
"
src/
bootstrap"
,
"
src/
rustc"
,
"
src/
libstd"
,
"
src/
libtest"
,
"
src/
librustc_codegen_llvm"
,
"
src/
tools/cargotest"
,
"
src/
tools/clippy"
,
"
src/
tools/compiletest"
,
"
src/
tools/error_index_generator"
,
"
src/
tools/linkchecker"
,
"
src/
tools/rustbook"
,
"
src/
tools/unstable-book-gen"
,
"
src/
tools/tidy"
,
"
src/
tools/build-manifest"
,
"
src/
tools/remote-test-client"
,
"
src/
tools/remote-test-server"
,
"
src/
tools/rust-installer"
,
"
src/
tools/cargo"
,
"
src/
tools/rustdoc"
,
"
src/
tools/rls"
,
"
src/
tools/rustfmt"
,
"
src/
tools/miri"
,
"
src/
tools/rustdoc-themes"
,
]
exclude
=
[
"tools/rls/test_data"
,
"
src/
tools/rls/test_data"
,
]
# Curiously, LLVM 7.0 will segfault if compiled with opt-level=3
...
...
@@ -50,18 +50,18 @@ debug-assertions = false
# so we use a `[patch]` here to override the github repository with our local
# vendored copy.
[patch."https://github.com/rust-lang/cargo"]
cargo
=
{
path
=
"tools/cargo"
}
cargo
=
{
path
=
"
src/
tools/cargo"
}
[patch.crates-io]
# Similar to Cargo above we want the RLS to use a vendored version of `rustfmt`
# that we're shipping as well (to ensure that the rustfmt in RLS and the
# `rustfmt` executable are the same exact version).
rustfmt-nightly
=
{
path
=
"tools/rustfmt"
}
rustfmt-nightly
=
{
path
=
"
src/
tools/rustfmt"
}
# See comments in `tools/rustc-workspace-hack/README.md` for what's going on
# See comments in `
src/
tools/rustc-workspace-hack/README.md` for what's going on
# here
rustc-workspace-hack
=
{
path
=
'tools/rustc-workspace-hack'
}
rustc-workspace-hack
=
{
path
=
'
src/
tools/rustc-workspace-hack'
}
[patch."https://github.com/rust-lang-nursery/rust-clippy"]
clippy_lints
=
{
path
=
"tools/clippy/clippy_lints"
}
rustc_tools_util
=
{
path
=
"tools/clippy/rustc_tools_util"
}
clippy_lints
=
{
path
=
"
src/
tools/clippy/clippy_lints"
}
rustc_tools_util
=
{
path
=
"
src/
tools/clippy/rustc_tools_util"
}
src/bootstrap/bootstrap.py
浏览文件 @
7c166f54
...
...
@@ -801,7 +801,7 @@ def bootstrap(help_triggered):
registry = 'https://example.com'
[source.vendored-sources]
directory = '{}/
src/
vendor'
directory = '{}/vendor'
"""
.
format
(
build
.
rust_root
))
else
:
if
os
.
path
.
exists
(
'.cargo'
):
...
...
src/bootstrap/dist.rs
浏览文件 @
7c166f54
...
...
@@ -851,7 +851,7 @@ fn run(self, builder: &Builder) -> PathBuf {
t!
(
fs
::
create_dir_all
(
&
dst_src
));
let
src_files
=
[
"
src/
Cargo.lock"
,
"Cargo.lock"
,
];
// This is the reduced set of paths which will become the rust-src component
// (essentially libstd and all of its path dependencies)
...
...
@@ -949,6 +949,8 @@ fn run(self, builder: &Builder) -> PathBuf {
"configure"
,
"x.py"
,
"config.toml.example"
,
"Cargo.toml"
,
"Cargo.lock"
,
];
let
src_dirs
=
[
"src"
,
...
...
@@ -992,7 +994,7 @@ fn run(self, builder: &Builder) -> PathBuf {
// Vendor all Cargo dependencies
let
mut
cmd
=
Command
::
new
(
&
builder
.initial_cargo
);
cmd
.arg
(
"vendor"
)
.current_dir
(
&
plain_dst_src
.join
(
"src"
)
);
.current_dir
(
&
plain_dst_src
);
builder
.run
(
&
mut
cmd
);
}
...
...
src/bootstrap/test.rs
浏览文件 @
7c166f54
...
...
@@ -1934,6 +1934,7 @@ fn run(self, builder: &Builder) {
.arg
(
"generate-lockfile"
)
.arg
(
"--manifest-path"
)
.arg
(
&
toml
)
.env
(
"__CARGO_TEST_ROOT"
,
&
dir
)
.current_dir
(
&
dir
),
);
}
...
...
src/bootstrap/tool.rs
浏览文件 @
7c166f54
...
...
@@ -260,8 +260,13 @@ pub fn prepare_tool_cargo(
}
macro_rules!
tool
{
(
$
(
$name:ident
,
$path:expr
,
$tool_name:expr
,
$mode:expr
$
(,
llvm_tools
=
$llvm:expr
)
*
$
(,
is_external_tool
=
$external:expr
)
*
;)
+
)
=>
{
(
$
(
$name:ident
,
$path:expr
,
$tool_name:expr
,
$mode:expr
$
(,
llvm_tools
=
$llvm:expr
)
*
$
(,
is_external_tool
=
$external:expr
)
*
$
(,
cargo_test_root
=
$cargo_test_root:expr
)
*
;
)
+
)
=>
{
#[derive(Copy,
PartialEq,
Eq,
Clone)]
pub
enum
Tool
{
$
(
...
...
@@ -283,6 +288,15 @@ pub fn uses_llvm_tools(&self) -> bool {
$
(
Tool
::
$name
=>
false
$
(||
$llvm
)
*
,)
+
}
}
/// Whether this tool requires may run Cargo for test crates,
/// which currently needs setting the environment variable
/// `__CARGO_TEST_ROOT` to separate it from the workspace.
pub
fn
needs_cargo_test_root
(
&
self
)
->
bool
{
match
self
{
$
(
Tool
::
$name
=>
false
$
(||
$cargo_test_root
)
*
,)
+
}
}
}
impl
<
'a
>
Builder
<
'a
>
{
...
...
@@ -358,8 +372,9 @@ fn run(self, builder: &Builder) -> PathBuf {
UnstableBookGen
,
"src/tools/unstable-book-gen"
,
"unstable-book-gen"
,
Mode
::
ToolBootstrap
;
Tidy
,
"src/tools/tidy"
,
"tidy"
,
Mode
::
ToolBootstrap
;
Linkchecker
,
"src/tools/linkchecker"
,
"linkchecker"
,
Mode
::
ToolBootstrap
;
CargoTest
,
"src/tools/cargotest"
,
"cargotest"
,
Mode
::
ToolBootstrap
;
Compiletest
,
"src/tools/compiletest"
,
"compiletest"
,
Mode
::
ToolBootstrap
,
llvm_tools
=
true
;
CargoTest
,
"src/tools/cargotest"
,
"cargotest"
,
Mode
::
ToolBootstrap
,
cargo_test_root
=
true
;
Compiletest
,
"src/tools/compiletest"
,
"compiletest"
,
Mode
::
ToolBootstrap
,
llvm_tools
=
true
,
cargo_test_root
=
true
;
BuildManifest
,
"src/tools/build-manifest"
,
"build-manifest"
,
Mode
::
ToolBootstrap
;
RemoteTestClient
,
"src/tools/remote-test-client"
,
"remote-test-client"
,
Mode
::
ToolBootstrap
;
RustInstaller
,
"src/tools/rust-installer"
,
"fabricate"
,
Mode
::
ToolBootstrap
,
...
...
@@ -678,6 +693,11 @@ fn prepare_tool_cmd(&self, compiler: Compiler, tool: Tool, cmd: &mut Command) {
}
}
// Set `__CARGO_TEST_ROOT` to the build directory if needed.
if
tool
.needs_cargo_test_root
()
{
cmd
.env
(
"__CARGO_TEST_ROOT"
,
&
self
.config.out
);
}
add_lib_path
(
lib_paths
,
cmd
);
}
...
...
src/test/rustdoc-ui/failed-doctest-output.stdout
浏览文件 @
7c166f54
...
...
@@ -12,7 +12,7 @@ error[E0425]: cannot find value `no` in this scope
3 | no
| ^^ not found in this scope
thread '$DIR/failed-doctest-output.rs - OtherStruct (line 27)' panicked at 'couldn't compile the test', librustdoc/test.rs:323:13
thread '$DIR/failed-doctest-output.rs - OtherStruct (line 27)' panicked at 'couldn't compile the test',
src/
librustdoc/test.rs:323:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.
---- $DIR/failed-doctest-output.rs - SomeStruct (line 21) stdout ----
...
...
@@ -21,7 +21,7 @@ thread '$DIR/failed-doctest-output.rs - SomeStruct (line 21)' panicked at 'test
thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
', librustdoc/test.rs:358:17
',
src/
librustdoc/test.rs:358:17
failures:
...
...
src/tools/tidy/src/deps.rs
浏览文件 @
7c166f54
...
...
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! Check license of third-party deps by inspecting
src/
vendor
//! Check license of third-party deps by inspecting vendor
use
std
::
collections
::{
BTreeSet
,
HashSet
,
HashMap
};
use
std
::
fs
::
File
;
...
...
@@ -203,7 +203,7 @@ fn from(cv: CrateVersion<'a>) -> Crate<'a> {
/// Specifically, this checks that the license is correct.
pub
fn
check
(
path
:
&
Path
,
bad
:
&
mut
bool
)
{
// Check licences
let
path
=
path
.join
(
"vendor"
);
let
path
=
path
.join
(
"
../
vendor"
);
assert
!
(
path
.exists
(),
"vendor directory missing"
);
let
mut
saw_dir
=
false
;
for
dir
in
t!
(
path
.read_dir
())
{
...
...
@@ -215,7 +215,7 @@ pub fn check(path: &Path, bad: &mut bool) {
dir
.path
()
.to_str
()
.unwrap
()
.contains
(
&
format!
(
"
src/
vendor/{}"
,
exception
))
.contains
(
&
format!
(
"vendor/{}"
,
exception
))
});
if
is_exception
{
continue
;
...
...
@@ -304,7 +304,7 @@ fn get_deps(path: &Path, cargo: &Path) -> Resolve {
.arg
(
"--format-version"
)
.arg
(
"1"
)
.arg
(
"--manifest-path"
)
.arg
(
path
.join
(
"Cargo.toml"
))
.arg
(
path
.join
(
"
../
Cargo.toml"
))
.output
()
.expect
(
"Unable to run `cargo metadata`"
)
.stdout
;
...
...
src/tools/tidy/src/extdeps.rs
浏览文件 @
7c166f54
...
...
@@ -21,8 +21,8 @@
/// check for external package sources
pub
fn
check
(
path
:
&
Path
,
bad
:
&
mut
bool
)
{
// Cargo.lock of rust
: src/Cargo.lock
let
path
=
path
.join
(
"Cargo.lock"
);
// Cargo.lock of rust
(tidy runs inside src/)
let
path
=
path
.join
(
"
../
Cargo.lock"
);
// open and read the whole file
let
mut
cargo_lock
=
String
::
new
();
...
...
src/tools/tidy/src/lib.rs
浏览文件 @
7c166f54
...
...
@@ -64,7 +64,6 @@ fn filter_dirs(path: &Path) -> bool {
"src/librustc_data_structures/owning_ref"
,
"src/compiler-rt"
,
"src/liblibc"
,
"src/vendor"
,
"src/rt/hoedown"
,
"src/tools/cargo"
,
"src/tools/clang"
,
...
...
@@ -78,6 +77,7 @@ fn filter_dirs(path: &Path) -> bool {
"src/target"
,
"src/stdsimd"
,
"target"
,
"vendor"
,
];
skip
.iter
()
.any
(|
p
|
path
.ends_with
(
p
))
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录