diff --git a/Cargo.lock b/Cargo.lock index cedf44be85bda..905f523aa53d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -404,9 +404,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.0.54" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" +checksum = "0fde55d2a2bfaa4c9668bbc63f531fbdeee3ffe188f4662511ce2c22b3eedebe" dependencies = [ "jobserver", ] @@ -1366,8 +1366,8 @@ checksum = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" name = "installer" version = "0.0.0" dependencies = [ + "anyhow", "clap", - "failure", "flate2", "lazy_static", "num_cpus", diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index cceb794165059..e8ec575ea3746 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -9,6 +9,7 @@ //! ensure that they're always in place if needed. use std::env; +use std::env::consts::EXE_EXTENSION; use std::ffi::OsString; use std::fs::{self, File}; use std::io; @@ -252,8 +253,14 @@ impl Step for Llvm { // FIXME: if the llvm root for the build triple is overridden then we // should use llvm-tblgen from there, also should verify that it // actually exists most of the time in normal installs of LLVM. - let host = builder.llvm_out(builder.config.build).join("bin/llvm-tblgen"); - cfg.define("CMAKE_CROSSCOMPILING", "True").define("LLVM_TABLEGEN", &host); + let host_bin = builder.llvm_out(builder.config.build).join("bin"); + cfg.define("CMAKE_CROSSCOMPILING", "True"); + cfg.define("LLVM_TABLEGEN", host_bin.join("llvm-tblgen").with_extension(EXE_EXTENSION)); + cfg.define("LLVM_NM", host_bin.join("llvm-nm").with_extension(EXE_EXTENSION)); + cfg.define( + "LLVM_CONFIG_PATH", + host_bin.join("llvm-config").with_extension(EXE_EXTENSION), + ); if target.contains("netbsd") { cfg.define("CMAKE_SYSTEM_NAME", "NetBSD"); @@ -262,8 +269,6 @@ impl Step for Llvm { } else if target.contains("windows") { cfg.define("CMAKE_SYSTEM_NAME", "Windows"); } - - cfg.define("LLVM_NATIVE_BUILD", builder.llvm_out(builder.config.build).join("build")); } if let Some(ref suffix) = builder.config.llvm_version_suffix { @@ -431,6 +436,9 @@ fn configure_cmake( cflags.push_str(" -miphoneos-version-min=10.0"); } } + if builder.config.llvm_clang_cl.is_some() { + cflags.push_str(&format!(" --target={}", target)) + } cfg.define("CMAKE_C_FLAGS", cflags); let mut cxxflags = builder.cflags(target, GitRepo::Llvm).join(" "); if builder.config.llvm_static_stdcpp && !target.contains("msvc") && !target.contains("netbsd") { @@ -439,6 +447,9 @@ fn configure_cmake( if let Some(ref s) = builder.config.llvm_cxxflags { cxxflags.push_str(&format!(" {}", s)); } + if builder.config.llvm_clang_cl.is_some() { + cxxflags.push_str(&format!(" --target={}", target)) + } cfg.define("CMAKE_CXX_FLAGS", cxxflags); if let Some(ar) = builder.ar(target) { if ar.is_absolute() { @@ -484,7 +495,7 @@ impl Step for Lld { run.builder.ensure(Lld { target: run.target }); } - /// Compile LLVM for `target`. + /// Compile LLD for `target`. fn run(self, builder: &Builder<'_>) -> PathBuf { if builder.config.dry_run { return PathBuf::from("lld-out-dir-test-gen"); @@ -521,6 +532,7 @@ impl Step for Lld { // can't build on a system where your paths require `\` on Windows, but // there's probably a lot of reasons you can't do that other than this. let llvm_config_shim = env::current_exe().unwrap().with_file_name("llvm-config-wrapper"); + cfg.out_dir(&out_dir) .profile("Release") .env("LLVM_CONFIG_REAL", &llvm_config) @@ -543,7 +555,10 @@ impl Step for Lld { if target != builder.config.build { cfg.env("LLVM_CONFIG_SHIM_REPLACE", &builder.config.build) .env("LLVM_CONFIG_SHIM_REPLACE_WITH", &target) - .define("LLVM_TABLEGEN_EXE", llvm_config.with_file_name("llvm-tblgen")); + .define( + "LLVM_TABLEGEN_EXE", + llvm_config.with_file_name("llvm-tblgen").with_extension(EXE_EXTENSION), + ); } // Explicitly set C++ standard, because upstream doesn't do so @@ -595,8 +610,8 @@ impl Step for TestHelpers { } // We may have found various cross-compilers a little differently due to our - // extra configuration, so inform gcc of these compilers. Note, though, that - // on MSVC we still need gcc's detection of env vars (ugh). + // extra configuration, so inform cc of these compilers. Note, though, that + // on MSVC we still need cc's detection of env vars (ugh). if !target.contains("msvc") { if let Some(ar) = builder.ar(target) { cfg.archiver(ar); diff --git a/src/doc/book b/src/doc/book index 4e7c00bece154..84a31397b34f9 160000 --- a/src/doc/book +++ b/src/doc/book @@ -1 +1 @@ -Subproject commit 4e7c00bece1544d409312ec93467beb62b5bd0cb +Subproject commit 84a31397b34f9d405df44f2899ff17a4828dba18 diff --git a/src/doc/embedded-book b/src/doc/embedded-book index 616962ad0dd80..94d9ea8460bcb 160000 --- a/src/doc/embedded-book +++ b/src/doc/embedded-book @@ -1 +1 @@ -Subproject commit 616962ad0dd80f34d8b802da038d0aed9dd691bb +Subproject commit 94d9ea8460bcbbbfef1877b47cb930260b5849a7 diff --git a/src/doc/reference b/src/doc/reference index 04d5d5d7ba624..0ea7bc494f128 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit 04d5d5d7ba624b6f5016298451f3a63d557f3260 +Subproject commit 0ea7bc494f1289234d8800bb9185021e0ad946f0 diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example index 6f94ccb48da6f..229c6945a26a5 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit 6f94ccb48da6fa4ed0031290f21411cf789f7d5e +Subproject commit 229c6945a26a53a751ffa4f9cb418388c00029d3 diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 84e1ebe5e01f5..20c0f4a3713cc 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -321,7 +321,7 @@ library, as an equivalent command-line argument is provided to `rustc` when buil ### `--index-page`: provide a top-level landing page for docs This feature allows you to generate an index-page with a given markdown file. A good example of it -is the [rust documentation index](https://doc.rust-lang.org/index.html). +is the [rust documentation index](https://doc.rust-lang.org/nightly/index.html). With this, you'll have a page which you can custom as much as you want at the top of your crates. diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index d7dc2174d665f..3d51115fe01d3 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -136,8 +136,6 @@ pub use hack::to_vec; // `test_permutations` test mod hack { use crate::boxed::Box; - #[cfg(test)] - use crate::string::ToString; use crate::vec::Vec; // We shouldn't add inline attribute to this since this is used in @@ -156,9 +154,9 @@ mod hack { where T: Clone, { - let mut vector = Vec::with_capacity(s.len()); - vector.extend_from_slice(s); - vector + let mut vec = Vec::with_capacity(s.len()); + vec.extend_from_slice(s); + vec } } diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 45a86cf2cc6cc..b7610b08b87fc 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -63,7 +63,7 @@ use rustc_middle::ty::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_session::lint::builtin::{ BARE_TRAIT_OBJECTS, ELIDED_LIFETIMES_IN_PATHS, EXPLICIT_OUTLIVES_REQUIREMENTS, - INTRA_DOC_LINK_RESOLUTION_FAILURE, INVALID_CODEBLOCK_ATTRIBUTE, MISSING_DOC_CODE_EXAMPLES, + INTRA_DOC_LINK_RESOLUTION_FAILURE, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS, }; use rustc_span::symbol::{Ident, Symbol}; @@ -305,7 +305,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) { add_lint_group!( "rustdoc", INTRA_DOC_LINK_RESOLUTION_FAILURE, - INVALID_CODEBLOCK_ATTRIBUTE, + INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS ); diff --git a/src/librustc_session/lint/builtin.rs b/src/librustc_session/lint/builtin.rs index 5deee6eb48e6a..aa2a133952f8f 100644 --- a/src/librustc_session/lint/builtin.rs +++ b/src/librustc_session/lint/builtin.rs @@ -404,7 +404,7 @@ declare_lint! { } declare_lint! { - pub INVALID_CODEBLOCK_ATTRIBUTE, + pub INVALID_CODEBLOCK_ATTRIBUTES, Warn, "codeblock attribute looks a lot like a known one" } @@ -602,7 +602,7 @@ declare_lint_pass! { UNSTABLE_NAME_COLLISIONS, IRREFUTABLE_LET_PATTERNS, INTRA_DOC_LINK_RESOLUTION_FAILURE, - INVALID_CODEBLOCK_ATTRIBUTE, + INVALID_CODEBLOCK_ATTRIBUTES, MISSING_CRATE_LEVEL_DOCS, MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS, diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 38f202e84accb..db98ec5d0a72e 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -214,7 +214,7 @@ pub fn new_handler( /// This function is used to setup the lint initialization. By default, in rustdoc, everything /// is "allowed". Depending if we run in test mode or not, we want some of them to be at their -/// default level. For example, the "INVALID_CODEBLOCK_ATTRIBUTE" lint is activated in both +/// default level. For example, the "INVALID_CODEBLOCK_ATTRIBUTES" lint is activated in both /// modes. /// /// A little detail easy to forget is that there is a way to set the lint level for all lints @@ -315,7 +315,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name; let private_doc_tests = rustc_lint::builtin::PRIVATE_DOC_TESTS.name; let no_crate_level_docs = rustc_lint::builtin::MISSING_CRATE_LEVEL_DOCS.name; - let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE.name; + let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name; // In addition to those specific lints, we also need to whitelist those given through // command line, otherwise they'll get ignored and we don't want that. diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 7a6626766d388..a0f8eb04e2efb 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -665,7 +665,7 @@ impl<'a, 'b> ExtraInfo<'a, 'b> { (None, None) => return, }; self.tcx.struct_span_lint_hir( - lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE, + lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES, hir_id, self.sp, |lint| { diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index e9504aa3af123..a89cb130c6b05 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -46,7 +46,7 @@ pub struct TestOptions { pub fn run(options: Options) -> Result<(), String> { let input = config::Input::File(options.input.clone()); - let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE.name; + let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name; // In addition to those specific lints, we also need to whitelist those given through // command line, otherwise they'll get ignored and we don't want that. diff --git a/src/llvm-project b/src/llvm-project index 6c040dd86ed62..d134a53927fa0 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 6c040dd86ed62d38e585279027486e6efc42fb36 +Subproject commit d134a53927fa033ae7e0f3e8ee872ff2dc71468d diff --git a/src/test/rustdoc-ui/check-attr-test.rs b/src/test/rustdoc-ui/check-attr-test.rs index c4140bbb70a78..665f330e34ea5 100644 --- a/src/test/rustdoc-ui/check-attr-test.rs +++ b/src/test/rustdoc-ui/check-attr-test.rs @@ -1,6 +1,6 @@ // compile-flags:--test -#![deny(invalid_codeblock_attribute)] +#![deny(invalid_codeblock_attributes)] /// foo /// diff --git a/src/test/rustdoc-ui/check-attr-test.stderr b/src/test/rustdoc-ui/check-attr-test.stderr index 45a2d6ec15e7d..1e067a5d21c44 100644 --- a/src/test/rustdoc-ui/check-attr-test.stderr +++ b/src/test/rustdoc-ui/check-attr-test.stderr @@ -11,8 +11,8 @@ error: unknown attribute `compile-fail`. Did you mean `compile_fail`? note: the lint level is defined here --> $DIR/check-attr-test.rs:3:9 | -3 | #![deny(invalid_codeblock_attribute)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | #![deny(invalid_codeblock_attributes)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: the code block will either not be tested if not marked as a rust one or won't fail if it compiles successfully error: unknown attribute `compilefail`. Did you mean `compile_fail`? diff --git a/src/test/rustdoc-ui/check-attr.rs b/src/test/rustdoc-ui/check-attr.rs index a93ec29131907..9e02eab753e26 100644 --- a/src/test/rustdoc-ui/check-attr.rs +++ b/src/test/rustdoc-ui/check-attr.rs @@ -1,4 +1,4 @@ -#![deny(invalid_codeblock_attribute)] +#![deny(invalid_codeblock_attributes)] /// foo //~^ ERROR diff --git a/src/test/rustdoc-ui/check-attr.stderr b/src/test/rustdoc-ui/check-attr.stderr index 5d6939bd09205..919eb047eefb5 100644 --- a/src/test/rustdoc-ui/check-attr.stderr +++ b/src/test/rustdoc-ui/check-attr.stderr @@ -13,8 +13,8 @@ LL | | /// ``` note: the lint level is defined here --> $DIR/check-attr.rs:1:9 | -LL | #![deny(invalid_codeblock_attribute)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![deny(invalid_codeblock_attributes)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: the code block will either not be tested if not marked as a rust one or won't fail if it compiles successfully error: unknown attribute `compilefail`. Did you mean `compile_fail`? diff --git a/src/test/ui/consts/const-eval/ub-enum.rs b/src/test/ui/consts/const-eval/ub-enum.rs index c49997c6c33f6..136b33208c293 100644 --- a/src/test/ui/consts/const-eval/ub-enum.rs +++ b/src/test/ui/consts/const-eval/ub-enum.rs @@ -88,9 +88,10 @@ const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute //~^ ERROR is undefined behavior // All variants are uninhabited but also have data. -const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(1u64) }; +// Use `0` as constant to make behavior endianess-independent. +const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) }; //~^ ERROR is undefined behavior -const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(1u64) }; +const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) }; //~^ ERROR is undefined behavior fn main() { diff --git a/src/test/ui/consts/const-eval/ub-enum.stderr b/src/test/ui/consts/const-eval/ub-enum.stderr index 217bfb628a018..7b3ee535c8ec6 100644 --- a/src/test/ui/consts/const-eval/ub-enum.stderr +++ b/src/test/ui/consts/const-eval/ub-enum.stderr @@ -87,18 +87,18 @@ LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::tran = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. error[E0080]: it is undefined behavior to use this value - --> $DIR/ub-enum.rs:91:1 + --> $DIR/ub-enum.rs:92:1 | -LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(1u64) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at ..0.1 +LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Never at ..0.1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. error[E0080]: it is undefined behavior to use this value - --> $DIR/ub-enum.rs:93:1 + --> $DIR/ub-enum.rs:94:1 | -LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(1u64) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Never at ..0.1 +LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at ..0.1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. diff --git a/src/tools/miri b/src/tools/miri index fd8101247749c..578aebf478f3b 160000 --- a/src/tools/miri +++ b/src/tools/miri @@ -1 +1 @@ -Subproject commit fd8101247749c5be6850d5cb5096f01a1867e5ba +Subproject commit 578aebf478f3bd0ff7f4826d1b64254fe032c191 diff --git a/src/tools/rust-installer b/src/tools/rust-installer index 9f66c14c3f91a..d66f476b4d5e7 160000 --- a/src/tools/rust-installer +++ b/src/tools/rust-installer @@ -1 +1 @@ -Subproject commit 9f66c14c3f91a48a118c7817f434167b311c3515 +Subproject commit d66f476b4d5e7fdf1ec215c9ac16c923dc292324