Skip to content

Commit

Permalink
Merge branch 'master' into frewsxcv-dyn
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv authored Nov 23, 2018
2 parents 033cbfe + 821bad3 commit ebb1a48
Show file tree
Hide file tree
Showing 204 changed files with 2,034 additions and 1,218 deletions.
7 changes: 1 addition & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
176 changes: 108 additions & 68 deletions src/Cargo.lock → Cargo.lock

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions src/Cargo.toml → Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[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
Expand All @@ -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" }
77 changes: 77 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
Version 1.31.0 (2018-12-06)
==========================

Language
--------
- 🎉 [This version marks the release of the 2018 edition of Rust.][54057] 🎉
- [New lifetime elision rules now allow for eliding lifetimes in functions and
impl headers.][54778] E.g. `impl<'a> Reader for BufReader<'a> {}` can now be
`impl Reader for BufReader<'_> {}`. Lifetimes are still required to be defined
in structs.
- [You can now define and use `const` functions.][54835] These are currently
a strict minimal subset of the [const fn RFC][RFC-911]. Refer to the
[language reference][const-reference] for what exactly is available.
- [You can now use tool lints, which allow you to scope lints from external
tools using attributes.][54870] E.g. `#[allow(clippy::filter_map)]`.
- [`#[no_mangle]` and `#[export_name]` attributes can now be located anywhere in
a crate, not just in exported functions.][54451]
- [You can now use parentheses in pattern matches.][54497]

Compiler
--------
- [Updated musl to 1.1.20][54430]

Libraries
---------
- [You can now convert `num::NonZero*` types to their raw equivalvents using the
`From` trait.][54240] E.g. `u8` now implements `From<NonZeroU8>`.
- [You can now convert a `&Option<T>` into `Option<&T>` and `&mut Option<T>`
into `Option<&mut T>` using the `From` trait.][53218]
- [You can now multiply (`*`) a `time::Duration` by a `u32`.][52813]


Stabilized APIs
---------------
- [`slice::align_to`]
- [`slice::align_to_mut`]
- [`slice::chunks_exact`]
- [`slice::chunks_exact_mut`]
- [`slice::rchunks`]
- [`slice::rchunks_mut`]
- [`slice::rchunks_exact`]
- [`slice::rchunks_exact_mut`]
- [`Option::replace`]

Cargo
-----
- [Cargo will now download crates in parallel using HTTP/2.][cargo/6005]
- [You can now rename packages in your Cargo.toml][cargo/6319] We have a guide
on [how to use the `package` key in your dependencies.][cargo-rename-reference]

[52813]: https://github.com/rust-lang/rust/pull/52813/
[53218]: https://github.com/rust-lang/rust/pull/53218/
[53555]: https://github.com/rust-lang/rust/issues/53555/
[54057]: https://github.com/rust-lang/rust/pull/54057/
[54240]: https://github.com/rust-lang/rust/pull/54240/
[54430]: https://github.com/rust-lang/rust/pull/54430/
[54451]: https://github.com/rust-lang/rust/pull/54451/
[54497]: https://github.com/rust-lang/rust/pull/54497/
[54778]: https://github.com/rust-lang/rust/pull/54778/
[54835]: https://github.com/rust-lang/rust/pull/54835/
[54870]: https://github.com/rust-lang/rust/pull/54870/
[RFC-911]: https://github.com/rust-lang/rfcs/pull/911
[`Option::replace`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.replace
[`slice::align_to_mut`]: https://doc.rust-lang.org/std/primitive.slice.html#method.align_to_mut
[`slice::align_to`]: https://doc.rust-lang.org/std/primitive.slice.html#method.align_to
[`slice::chunks_exact_mut`]: https://doc.rust-lang.org/std/primitive.slice.html#method.chunks_exact_mut
[`slice::chunks_exact`]: https://doc.rust-lang.org/std/primitive.slice.html#method.chunks_exact
[`slice::rchunks_exact_mut`]: https://doc.rust-lang.org/std/primitive.slice.html#method.rchunks_mut
[`slice::rchunks_exact`]: https://doc.rust-lang.org/std/primitive.slice.html#method.rchunks_exact
[`slice::rchunks_mut`]: https://doc.rust-lang.org/std/primitive.slice.html#method.rchunks_mut
[`slice::rchunks`]: https://doc.rust-lang.org/std/primitive.slice.html#method.rchunks
[cargo/6005]: https://github.com/rust-lang/cargo/pull/6005/
[cargo/6319]: https://github.com/rust-lang/cargo/pull/6319/
[cargo-rename-reference]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
[const-reference]: https://doc.rust-lang.org/reference/items/functions.html#const-functions


Version 1.30.0 (2018-10-25)
==========================

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
6 changes: 4 additions & 2 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ impl Step for Src {
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)
Expand Down Expand Up @@ -949,6 +949,8 @@ impl Step for PlainSourceTarball {
"configure",
"x.py",
"config.toml.example",
"Cargo.toml",
"Cargo.lock",
];
let src_dirs = [
"src",
Expand Down Expand Up @@ -992,7 +994,7 @@ impl Step for PlainSourceTarball {
// 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);
}

Expand Down
26 changes: 15 additions & 11 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,22 +260,31 @@ impl Step for TheBook {
let compiler = self.compiler;
let target = self.target;
let name = self.name;
// build book first edition

// build book
builder.ensure(Rustbook {
target,
name: INTERNER.intern_string(format!("{}/first-edition", name)),
name: INTERNER.intern_string(name.to_string()),
});

// build book second edition
// building older edition redirects

let source_name = format!("{}/first-edition", name);
builder.ensure(Rustbook {
target,
name: INTERNER.intern_string(format!("{}/second-edition", name)),
name: INTERNER.intern_string(source_name),
});

// build book 2018 edition
let source_name = format!("{}/second-edition", name);
builder.ensure(Rustbook {
target,
name: INTERNER.intern_string(format!("{}/2018-edition", name)),
name: INTERNER.intern_string(source_name),
});

let source_name = format!("{}/2018-edition", name);
builder.ensure(Rustbook {
target,
name: INTERNER.intern_string(source_name),
});

// build the version info page and CSS
Expand All @@ -284,11 +293,6 @@ impl Step for TheBook {
target,
});

// build the index page
let index = format!("{}/index.md", name);
builder.info(&format!("Documenting book index ({})", target));
invoke_rustdoc(builder, compiler, target, &index);

// build the redirect pages
builder.info(&format!("Documenting book redirect pages ({})", target));
for file in t!(fs::read_dir(builder.src.join("src/doc/book/redirects"))) {
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,7 @@ impl Step for Distcheck {
.arg("generate-lockfile")
.arg("--manifest-path")
.arg(&toml)
.env("__CARGO_TEST_ROOT", &dir)
.current_dir(&dir),
);
}
Expand Down
30 changes: 26 additions & 4 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use util::{exe, add_lib_path};
use compile;
use native;
use channel::GitInfo;
use channel;
use cache::Interned;
use toolstate::ToolState;

Expand Down Expand Up @@ -240,6 +241,7 @@ pub fn prepare_tool_cargo(

cargo.env("CFG_RELEASE_CHANNEL", &builder.config.channel);
cargo.env("CFG_VERSION", builder.rust_version());
cargo.env("CFG_RELEASE_NUM", channel::CFG_RELEASE_NUM);

let info = GitInfo::new(&builder.config, &dir);
if let Some(sha) = info.sha() {
Expand All @@ -258,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 {
$(
Expand All @@ -281,6 +288,15 @@ macro_rules! tool {
$(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> {
Expand Down Expand Up @@ -356,8 +372,9 @@ tool!(
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,
Expand Down Expand Up @@ -676,6 +693,11 @@ impl<'a> Builder<'a> {
}
}

// 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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/doc/book
Submodule book updated 438 files
2 changes: 1 addition & 1 deletion src/doc/nomicon
2 changes: 1 addition & 1 deletion src/doc/reference
2 changes: 1 addition & 1 deletion src/doc/rust-by-example
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ The tracking issue for this feature is: [#35625]

The RFC is: [rfc#1576].

With this feature gate enabled, the [list of fragment specifiers][frags] gains one more entry:
With this feature gate enabled, the [list of designators] gains one more entry:

* `literal`: a literal. Examples: 2, "string", 'c'

A `literal` may be followed by anything, similarly to the `ident` specifier.

[rfc#1576]: http://rust-lang.github.io/rfcs/1576-macros-literal-matcher.html
[#35625]: https://github.com/rust-lang/rust/issues/35625
[frags]: ../book/first-edition/macros.html#syntactic-requirements
[list of designators]: ../reference/macros-by-example.html

------------------------
2 changes: 0 additions & 2 deletions src/doc/unstable-book/src/language-features/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ of extensions. See `Registry::register_syntax_extension` and the

## Tips and tricks

Some of the [macro debugging tips](../book/first-edition/macros.html#debugging-macro-code) are applicable.

You can use `syntax::parse` to turn token trees into
higher-level syntax elements like expressions:

Expand Down
Loading

0 comments on commit ebb1a48

Please sign in to comment.