From fb9fa5ba3ee08171e7d2ff35d28ec0dd93b0287b Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 3 Jul 2020 12:12:50 +0200 Subject: [PATCH 01/15] adjust ub-enum test to be endianess-independent --- src/test/ui/consts/const-eval/ub-enum.rs | 5 +++-- src/test/ui/consts/const-eval/ub-enum.stderr | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/test/ui/consts/const-eval/ub-enum.rs b/src/test/ui/consts/const-eval/ub-enum.rs index c49997c6c33f..136b33208c29 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 1f7593c6db9b..9c29aa1a51d1 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. From 6b59cac1197fafda31951aa05a55b0dd7871400f Mon Sep 17 00:00:00 2001 From: Nathaniel McCallum Date: Mon, 6 Jul 2020 14:32:30 -0400 Subject: [PATCH 02/15] Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes https://github.com/rust-lang/rust/issues/42779 cc https://github.com/rust-lang/rust/issues/32408 --- src/librustc_mir_build/build/mod.rs | 12 +++++++++++- src/test/codegen/naked-functions.rs | 4 ++-- src/test/debuginfo/function-arguments.rs | 17 +++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/librustc_mir_build/build/mod.rs b/src/librustc_mir_build/build/mod.rs index e69f6b30abd5..d6dd3711dba1 100644 --- a/src/librustc_mir_build/build/mod.rs +++ b/src/librustc_mir_build/build/mod.rs @@ -10,6 +10,7 @@ use rustc_hir::lang_items; use rustc_hir::{GeneratorKind, HirIdMap, Node}; use rustc_index::vec::{Idx, IndexVec}; use rustc_infer::infer::TyCtxtInferExt; +use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc_middle::middle::region; use rustc_middle::mir::*; use rustc_middle::ty::subst::Subst; @@ -790,12 +791,22 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { argument_scope: region::Scope, ast_body: &'tcx hir::Expr<'tcx>, ) -> BlockAnd<()> { + let tcx = self.hir.tcx(); + let attrs = tcx.codegen_fn_attrs(fn_def_id); + let naked = attrs.flags.contains(CodegenFnAttrFlags::NAKED); + // Allocate locals for the function arguments for &ArgInfo(ty, _, arg_opt, _) in arguments.iter() { let source_info = SourceInfo::outermost(arg_opt.map_or(self.fn_span, |arg| arg.pat.span)); let arg_local = self.local_decls.push(LocalDecl::with_source_info(ty, source_info)); + // Emit function argument debuginfo only for non-naked functions. + // See: https://github.com/rust-lang/rust/issues/42779 + if naked { + continue; + } + // If this is a simple binding pattern, give debuginfo a nice name. if let Some(arg) = arg_opt { if let Some(ident) = arg.pat.simple_ident() { @@ -808,7 +819,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } } - let tcx = self.hir.tcx(); let tcx_hir = tcx.hir(); let hir_tables = self.hir.tables(); diff --git a/src/test/codegen/naked-functions.rs b/src/test/codegen/naked-functions.rs index 493c1b9f0ba6..758c6c4da929 100644 --- a/src/test/codegen/naked-functions.rs +++ b/src/test/codegen/naked-functions.rs @@ -18,7 +18,7 @@ pub fn naked_empty() { // CHECK-NEXT: define void @naked_with_args(i{{[0-9]+( %0)?}}) pub fn naked_with_args(a: isize) { // CHECK-NEXT: {{.+}}: - // CHECK-NEXT: %a = alloca i{{[0-9]+}} + // CHECK-NEXT: %_1 = alloca i{{[0-9]+}} &a; // keep variable in an alloca // CHECK: ret void } @@ -39,7 +39,7 @@ pub fn naked_with_return() -> isize { #[naked] pub fn naked_with_args_and_return(a: isize) -> isize { // CHECK-NEXT: {{.+}}: - // CHECK-NEXT: %a = alloca i{{[0-9]+}} + // CHECK-NEXT: %_1 = alloca i{{[0-9]+}} &a; // keep variable in an alloca // CHECK: ret i{{[0-9]+}} %{{[0-9]+}} a diff --git a/src/test/debuginfo/function-arguments.rs b/src/test/debuginfo/function-arguments.rs index 5cfd7d1f8f19..fb0bbbf371d8 100644 --- a/src/test/debuginfo/function-arguments.rs +++ b/src/test/debuginfo/function-arguments.rs @@ -18,6 +18,10 @@ // gdb-check:$4 = 3000 // gdb-command:continue +// gdb-command:info args +// gdb-check:No arguments. +// gdb-command:continue + // === LLDB TESTS ================================================================================== // lldb-command:run @@ -38,7 +42,12 @@ // lldbr-check:(i64) b = 3000 // lldb-command:continue +// lldb-command:frame variable +// lldbg-check:(unsigned long) = 111 (unsigned long) = 222 +// lldbr-check:(unsigned long) = 111 (unsigned long) = 222 +// lldb-command:continue +#![feature(naked_functions)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] @@ -46,6 +55,7 @@ fn main() { fun(111102, true); nested(2000, 3000); + naked(111, 222); fn nested(a: i32, b: i64) -> (i32, i64) { zzz(); // #break @@ -59,4 +69,11 @@ fn fun(x: isize, y: bool) -> (isize, bool) { (x, y) } +#[naked] +fn naked(x: usize, y: usize) -> usize { + zzz(); // #break + + x + y +} + fn zzz() { () } From 5702e0289f7d19f0ea133d43da7dcd7cbfc5b557 Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Mon, 6 Jul 2020 20:42:19 +0100 Subject: [PATCH 03/15] Only allow `repr(i128/u128)` on enum --- src/librustc_passes/check_attr.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustc_passes/check_attr.rs b/src/librustc_passes/check_attr.rs index ef84f251390e..fee63b1ee524 100644 --- a/src/librustc_passes/check_attr.rs +++ b/src/librustc_passes/check_attr.rs @@ -292,6 +292,8 @@ impl CheckAttrVisitor<'tcx> { | sym::u32 | sym::i64 | sym::u64 + | sym::i128 + | sym::u128 | sym::isize | sym::usize => { int_reprs += 1; From 97867bbe5cd09df7754864c826f58d3029f4422e Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Mon, 6 Jul 2020 21:04:54 +0100 Subject: [PATCH 04/15] Add UI test for issue 74082 --- src/test/ui/issues/issue-74082.rs | 9 +++++++++ src/test/ui/issues/issue-74082.stderr | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/test/ui/issues/issue-74082.rs create mode 100644 src/test/ui/issues/issue-74082.stderr diff --git a/src/test/ui/issues/issue-74082.rs b/src/test/ui/issues/issue-74082.rs new file mode 100644 index 000000000000..982f8ef02538 --- /dev/null +++ b/src/test/ui/issues/issue-74082.rs @@ -0,0 +1,9 @@ +#![allow(dead_code)] + +#[repr(i128)] //~ ERROR: attribute should be applied to enum +struct Foo; + +#[repr(u128)] //~ ERROR: attribute should be applied to enum +struct Bar; + +fn main() {} diff --git a/src/test/ui/issues/issue-74082.stderr b/src/test/ui/issues/issue-74082.stderr new file mode 100644 index 000000000000..08fe415513d0 --- /dev/null +++ b/src/test/ui/issues/issue-74082.stderr @@ -0,0 +1,19 @@ +error[E0517]: attribute should be applied to enum + --> $DIR/issue-74082.rs:3:8 + | +LL | #[repr(i128)] + | ^^^^ +LL | struct Foo; + | ----------- not an enum + +error[E0517]: attribute should be applied to enum + --> $DIR/issue-74082.rs:6:8 + | +LL | #[repr(u128)] + | ^^^^ +LL | struct Bar; + | ----------- not an enum + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0517`. From 56fb71786a77706cefec8170bd06a5c990493b2b Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Tue, 7 Jul 2020 18:23:15 +0100 Subject: [PATCH 05/15] rustdoc: Rename invalid_codeblock_attribute lint to be plural --- src/librustc_lint/lib.rs | 4 ++-- src/librustc_session/lint/builtin.rs | 4 ++-- src/librustdoc/core.rs | 4 ++-- src/librustdoc/html/markdown.rs | 2 +- src/librustdoc/test.rs | 2 +- src/test/rustdoc-ui/check-attr-test.rs | 2 +- src/test/rustdoc-ui/check-attr-test.stderr | 4 ++-- src/test/rustdoc-ui/check-attr.rs | 2 +- src/test/rustdoc-ui/check-attr.stderr | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 4da98d201593..4556c3547f7f 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -62,7 +62,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}; @@ -304,7 +304,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 5deee6eb48e6..aa2a133952f8 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 38f202e84acc..db98ec5d0a72 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 7a6626766d38..a0f8eb04e2ef 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 e9504aa3af12..a89cb130c6b0 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/test/rustdoc-ui/check-attr-test.rs b/src/test/rustdoc-ui/check-attr-test.rs index c4140bbb70a7..665f330e34ea 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 45a2d6ec15e7..1e067a5d21c4 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 a93ec2913190..9e02eab753e2 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 5d6939bd0920..919eb047eefb 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`? From b50c13cc28b3c6c5968ec3f8cf0c1aa11e463d9f Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 7 Jul 2020 13:53:46 -0700 Subject: [PATCH 06/15] Update books --- src/doc/book | 2 +- src/doc/embedded-book | 2 +- src/doc/reference | 2 +- src/doc/rust-by-example | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/book b/src/doc/book index 4e7c00bece15..84a31397b34f 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 616962ad0dd8..94d9ea8460bc 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 04d5d5d7ba62..0ea7bc494f12 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 6f94ccb48da6..229c6945a26a 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit 6f94ccb48da6fa4ed0031290f21411cf789f7d5e +Subproject commit 229c6945a26a53a751ffa4f9cb418388c00029d3 From 32025fd76a2f95b339cc0cca8e779bebc06d7f70 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 24 May 2020 17:08:45 -0700 Subject: [PATCH 07/15] Update rust-installer to latest version This pulls in a fix for the install script on some tr(1) implementations, as well as an update to use `anyhow` instead of `failure` for error handling. --- Cargo.lock | 2 +- src/tools/rust-installer | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cedf44be85bd..2096a3dfff9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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/tools/rust-installer b/src/tools/rust-installer index 9f66c14c3f91..d66f476b4d5e 160000 --- a/src/tools/rust-installer +++ b/src/tools/rust-installer @@ -1 +1 @@ -Subproject commit 9f66c14c3f91a48a118c7817f434167b311c3515 +Subproject commit d66f476b4d5e7fdf1ec215c9ac16c923dc292324 From dd077746174b7ddbbd004b47f475c46cda3b5f27 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 8 Jul 2020 07:15:17 +0900 Subject: [PATCH 08/15] Fix broken link in rustdocdoc --- src/doc/rustdoc/src/unstable-features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 84e1ebe5e01f..20c0f4a3713c 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. From 7bc85e29c94084a5b24af4b38a6d9dd7f9177f06 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 8 Jul 2020 12:44:43 +0800 Subject: [PATCH 09/15] Liballoc use vec instead of vector Keep congruency with other parts, full word vector is rarely used. --- src/liballoc/slice.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index d7dc2174d665..3dbe24428663 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -156,9 +156,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 } } From 09654430017b9ed8488ca45c414410af1417a482 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 8 Jul 2020 12:47:19 +0800 Subject: [PATCH 10/15] Remove unneeded ToString import in liballoc slice --- src/liballoc/slice.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index d7dc2174d665..daa1a13c1ea3 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 From 3c63fba03daedf014b75e12f32f4daec3598f9a3 Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Tue, 7 Jul 2020 07:50:49 -0700 Subject: [PATCH 11/15] Correctly mark the ending span of a match arm Closes #74050 r? @matthewjasper --- src/librustc_parse/parser/expr.rs | 2 +- ....match_tuple.SimplifyCfg-initial.after.mir | 4 +- .../32bit/rustc.main.SimplifyArmIdentity.diff | 2 +- .../64bit/rustc.main.SimplifyArmIdentity.diff | 2 +- ...complicated_match.ElaborateDrops.after.mir | 44 +++++++++---------- ...icated_match.SimplifyCfg-initial.after.mir | 44 +++++++++---------- ...c.full_tested_match.PromoteTemps.after.mir | 12 ++--- ...full_tested_match2.PromoteTemps.before.mir | 12 ++--- .../rustc.main.PromoteTemps.before.mir | 24 +++++----- .../rustc.main.SimplifyCfg-initial.after.mir | 4 +- ...wrap.SimplifyCfg-elaborate-drops.after.mir | 2 +- ...tch_guard.CleanupNonCodegenStatements.diff | 4 +- .../32bit/rustc.main.SimplifyArmIdentity.diff | 2 +- .../64bit/rustc.main.SimplifyArmIdentity.diff | 2 +- .../rustc.id.SimplifyArmIdentity.diff | 2 +- .../rustc.id.SimplifyBranchSame.diff | 2 +- .../rustc.id_result.SimplifyArmIdentity.diff | 4 +- .../rustc.id_result.SimplifyBranchSame.diff | 4 +- ...c.{{impl}}-append.SimplifyArmIdentity.diff | 2 +- src/test/ui/match/issue-74050-end-span.rs | 13 ++++++ src/test/ui/match/issue-74050-end-span.stderr | 15 +++++++ 21 files changed, 115 insertions(+), 87 deletions(-) create mode 100644 src/test/ui/match/issue-74050-end-span.rs create mode 100644 src/test/ui/match/issue-74050-end-span.stderr diff --git a/src/librustc_parse/parser/expr.rs b/src/librustc_parse/parser/expr.rs index abb444933536..876ce3ab2cb4 100644 --- a/src/librustc_parse/parser/expr.rs +++ b/src/librustc_parse/parser/expr.rs @@ -1790,7 +1790,7 @@ impl<'a> Parser<'a> { let require_comma = classify::expr_requires_semi_to_be_stmt(&expr) && self.token != token::CloseDelim(token::Brace); - let hi = self.token.span; + let hi = self.prev_token.span; if require_comma { let sm = self.sess.source_map(); diff --git a/src/test/mir-opt/exponential-or/rustc.match_tuple.SimplifyCfg-initial.after.mir b/src/test/mir-opt/exponential-or/rustc.match_tuple.SimplifyCfg-initial.after.mir index b84ca5df9964..00942cd12b42 100644 --- a/src/test/mir-opt/exponential-or/rustc.match_tuple.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/exponential-or/rustc.match_tuple.SimplifyCfg-initial.after.mir @@ -102,8 +102,8 @@ fn match_tuple(_1: (u32, bool, std::option::Option, u32)) -> u32 { _0 = BitXor(move _9, move _10); // scope 1 at $DIR/exponential-or.rs:8:83: 8:88 StorageDead(_10); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88 StorageDead(_9); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88 - StorageDead(_8); // scope 0 at $DIR/exponential-or.rs:8:88: 8:89 - StorageDead(_7); // scope 0 at $DIR/exponential-or.rs:8:88: 8:89 + StorageDead(_8); // scope 0 at $DIR/exponential-or.rs:8:87: 8:88 + StorageDead(_7); // scope 0 at $DIR/exponential-or.rs:8:87: 8:88 goto -> bb10; // scope 0 at $DIR/exponential-or.rs:7:5: 10:6 } diff --git a/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff index e5b4a0328808..1020fc965fe8 100644 --- a/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff @@ -137,7 +137,7 @@ StorageLive(_4); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 _4 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 _1 = _4; // scope 2 at $DIR/issue-73223.rs:3:20: 3:21 - StorageDead(_4); // scope 0 at $DIR/issue-73223.rs:3:21: 3:22 + StorageDead(_4); // scope 0 at $DIR/issue-73223.rs:3:20: 3:21 StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7 StorageLive(_6); // scope 1 at $DIR/issue-73223.rs:7:9: 7:14 StorageLive(_7); // scope 1 at $DIR/issue-73223.rs:7:22: 7:27 diff --git a/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff index 0c2651dc3c68..aa606ed22b6d 100644 --- a/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff @@ -137,7 +137,7 @@ StorageLive(_4); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 _4 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 _1 = _4; // scope 2 at $DIR/issue-73223.rs:3:20: 3:21 - StorageDead(_4); // scope 0 at $DIR/issue-73223.rs:3:21: 3:22 + StorageDead(_4); // scope 0 at $DIR/issue-73223.rs:3:20: 3:21 StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7 StorageLive(_6); // scope 1 at $DIR/issue-73223.rs:7:9: 7:14 StorageLive(_7); // scope 1 at $DIR/issue-73223.rs:7:22: 7:27 diff --git a/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.ElaborateDrops.after.mir b/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.ElaborateDrops.after.mir index c6832f21208d..df6a247bb5ff 100644 --- a/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.ElaborateDrops.after.mir +++ b/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.ElaborateDrops.after.mir @@ -61,7 +61,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { // mir::Constant // + span: $DIR/match-arm-scopes.rs:16:77: 16:78 // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } - drop(_7) -> [return: bb19, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + drop(_7) -> [return: bb19, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 } bb6: { @@ -90,9 +90,9 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { // + span: $DIR/match-arm-scopes.rs:16:59: 16:60 // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) } StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 - StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 goto -> bb11; // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60 } @@ -109,7 +109,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { } bb12: { - StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18 _5 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18 StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21 @@ -118,9 +118,9 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { } bb13: { - StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 goto -> bb2; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73 } @@ -150,14 +150,14 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { // + span: $DIR/match-arm-scopes.rs:16:59: 16:60 // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) } StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 - StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 goto -> bb11; // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60 } bb17: { - StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27 _5 = (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27 StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37 @@ -166,17 +166,17 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { } bb18: { - StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 goto -> bb3; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73 } bb19: { - StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6 } @@ -188,7 +188,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { // mir::Constant // + span: $DIR/match-arm-scopes.rs:17:41: 17:42 // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) } - drop(_16) -> [return: bb22, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43 + drop(_16) -> [return: bb22, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42 } bb21: { @@ -200,8 +200,8 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { } bb22: { - StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43 - StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43 + StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42 + StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42 goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6 } diff --git a/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.SimplifyCfg-initial.after.mir b/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.SimplifyCfg-initial.after.mir index 45f7e91d097c..dadbc3668cb2 100644 --- a/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.SimplifyCfg-initial.after.mir @@ -74,7 +74,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { // mir::Constant // + span: $DIR/match-arm-scopes.rs:16:77: 16:78 // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } - drop(_7) -> [return: bb24, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + drop(_7) -> [return: bb24, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 } bb9: { @@ -110,9 +110,9 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { // + span: $DIR/match-arm-scopes.rs:16:59: 16:60 // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) } StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 - StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 goto -> bb15; // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60 } @@ -129,7 +129,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { } bb16: { - StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 @@ -142,9 +142,9 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { } bb17: { - StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 falseEdge -> [real: bb3, imaginary: bb4]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73 } @@ -181,14 +181,14 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { // + span: $DIR/match-arm-scopes.rs:16:59: 16:60 // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) } StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 - StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 goto -> bb15; // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60 } bb22: { - StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 @@ -201,17 +201,17 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { } bb23: { - StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 falseEdge -> [real: bb5, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73 } bb24: { - StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 - StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 + StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 + StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78 goto -> bb28; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6 } @@ -223,7 +223,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { // mir::Constant // + span: $DIR/match-arm-scopes.rs:17:41: 17:42 // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) } - drop(_16) -> [return: bb27, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43 + drop(_16) -> [return: bb27, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42 } bb26: { @@ -235,8 +235,8 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 { } bb27: { - StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43 - StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43 + StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42 + StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42 goto -> bb28; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6 } diff --git a/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir index d4a2afe29578..5ff4150d2ac1 100644 --- a/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir +++ b/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir @@ -97,7 +97,7 @@ fn full_tested_match() -> () { } bb8: { - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27 FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27 StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15 @@ -112,14 +112,14 @@ fn full_tested_match() -> () { // + span: $DIR/match_false_edges.rs:16:32: 16:33 // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:16:36: 16:37 - StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38 - StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38 + StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 + StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 } bb9: { - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38 - StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 + StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37 goto -> bb4; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27 } @@ -136,7 +136,7 @@ fn full_tested_match() -> () { // + span: $DIR/match_false_edges.rs:17:21: 17:22 // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) } StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:17:25: 17:26 - StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:17:26: 17:27 + StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:17:25: 17:26 goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 } diff --git a/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir index f1744a94fdc1..b79416fe31a4 100644 --- a/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir +++ b/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir @@ -62,7 +62,7 @@ fn full_tested_match2() -> () { // + span: $DIR/match_false_edges.rs:29:21: 29:22 // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) } StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:29:25: 29:26 - StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:29:26: 29:27 + StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:29:25: 29:26 goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 } @@ -89,7 +89,7 @@ fn full_tested_match2() -> () { } bb8: { - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27 FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27 StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15 @@ -104,14 +104,14 @@ fn full_tested_match2() -> () { // + span: $DIR/match_false_edges.rs:27:32: 27:33 // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:27:36: 27:37 - StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38 - StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38 + StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 + StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 } bb9: { - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38 - StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 + StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37 falseEdge -> [real: bb4, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27 } diff --git a/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir index 4ab4c4d341e2..5b449da93d49 100644 --- a/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir +++ b/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir @@ -70,7 +70,7 @@ fn main() -> () { // mir::Constant // + span: $DIR/match_false_edges.rs:39:15: 39:16 // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) } - StorageDead(_14); // scope 0 at $DIR/match_false_edges.rs:39:16: 39:17 + StorageDead(_14); // scope 0 at $DIR/match_false_edges.rs:39:15: 39:16 goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 } @@ -97,7 +97,7 @@ fn main() -> () { } bb8: { - StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34 + StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 FakeRead(ForGuardBinding, _7); // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28 StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16 @@ -109,14 +109,14 @@ fn main() -> () { // mir::Constant // + span: $DIR/match_false_edges.rs:36:32: 36:33 // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } - StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34 - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34 + StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 } bb9: { - StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34 - StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34 + StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 + StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33 falseEdge -> [real: bb2, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28 } @@ -130,7 +130,7 @@ fn main() -> () { // mir::Constant // + span: $DIR/match_false_edges.rs:37:15: 37:16 // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) } - StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:37:16: 37:17 + StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16 goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 } @@ -156,7 +156,7 @@ fn main() -> () { } bb13: { - StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35 + StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 FakeRead(ForGuardBinding, _11); // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29 StorageLive(_10); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15 @@ -168,14 +168,14 @@ fn main() -> () { // mir::Constant // + span: $DIR/match_false_edges.rs:38:33: 38:34 // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) } - StorageDead(_10); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35 - StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35 + StorageDead(_10); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 + StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 } bb14: { - StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35 - StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35 + StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 + StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34 falseEdge -> [real: bb4, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29 } diff --git a/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir index ef6c88d8005b..16895942cb81 100644 --- a/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir @@ -117,7 +117,7 @@ fn main() -> () { } bb10: { - StorageDead(_9); // scope 2 at $DIR/match_test.rs:13:24: 13:25 + StorageDead(_9); // scope 2 at $DIR/match_test.rs:13:23: 13:24 FakeRead(ForMatchGuard, _8); // scope 2 at $DIR/match_test.rs:13:18: 13:19 _3 = const 0_i32; // scope 2 at $DIR/match_test.rs:13:23: 13:24 // ty::Const @@ -130,7 +130,7 @@ fn main() -> () { } bb11: { - StorageDead(_9); // scope 2 at $DIR/match_test.rs:13:24: 13:25 + StorageDead(_9); // scope 2 at $DIR/match_test.rs:13:23: 13:24 falseEdge -> [real: bb3, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:13:18: 13:19 } diff --git a/src/test/mir-opt/no-drop-for-inactive-variant/rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/no-drop-for-inactive-variant/rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir index 2e8cfaea937d..f3f2b68e53d5 100644 --- a/src/test/mir-opt/no-drop-for-inactive-variant/rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/no-drop-for-inactive-variant/rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir @@ -43,7 +43,7 @@ fn unwrap(_1: std::option::Option) -> T { StorageLive(_3); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 _3 = move ((_1 as Some).0: T); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 _0 = move _3; // scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21 - StorageDead(_3); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:21: 9:22 + StorageDead(_3); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21 _6 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 return; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2 } diff --git a/src/test/mir-opt/remove_fake_borrows/rustc.match_guard.CleanupNonCodegenStatements.diff b/src/test/mir-opt/remove_fake_borrows/rustc.match_guard.CleanupNonCodegenStatements.diff index 7fc209778703..0822d8cc03c6 100644 --- a/src/test/mir-opt/remove_fake_borrows/rustc.match_guard.CleanupNonCodegenStatements.diff +++ b/src/test/mir-opt/remove_fake_borrows/rustc.match_guard.CleanupNonCodegenStatements.diff @@ -53,7 +53,7 @@ } bb5: { - StorageDead(_8); // scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27 + StorageDead(_8); // scope 0 at $DIR/remove_fake_borrows.rs:8:25: 8:26 - FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21 - FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21 - FakeRead(ForMatchGuard, _6); // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21 @@ -73,7 +73,7 @@ } bb6: { - StorageDead(_8); // scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27 + StorageDead(_8); // scope 0 at $DIR/remove_fake_borrows.rs:8:25: 8:26 goto -> bb1; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21 } diff --git a/src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff index 33a3403cada9..0de80f72a1e7 100644 --- a/src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff @@ -61,7 +61,7 @@ ((_2 as Foo).0: u8) = move _5; // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35 discriminant(_2) = 0; // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35 StorageDead(_5); // scope 3 at $DIR/simplify-arm-identity.rs:20:34: 20:35 - StorageDead(_4); // scope 1 at $DIR/simplify-arm-identity.rs:20:35: 20:36 + StorageDead(_4); // scope 1 at $DIR/simplify-arm-identity.rs:20:34: 20:35 goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6 } diff --git a/src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff index 7e4fe1c2dcc4..4fa0aff8fa0e 100644 --- a/src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff @@ -61,7 +61,7 @@ ((_2 as Foo).0: u8) = move _5; // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35 discriminant(_2) = 0; // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35 StorageDead(_5); // scope 3 at $DIR/simplify-arm-identity.rs:20:34: 20:35 - StorageDead(_4); // scope 1 at $DIR/simplify-arm-identity.rs:20:35: 20:36 + StorageDead(_4); // scope 1 at $DIR/simplify-arm-identity.rs:20:34: 20:35 goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6 } diff --git a/src/test/mir-opt/simplify-arm/rustc.id.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm/rustc.id.SimplifyArmIdentity.diff index daae94e87f04..0cddcb061cfc 100644 --- a/src/test/mir-opt/simplify-arm/rustc.id.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/simplify-arm/rustc.id.SimplifyArmIdentity.diff @@ -33,7 +33,7 @@ ((_0 as Some).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27 discriminant(_0) = 1; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27 StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:11:26: 11:27 - StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:11:27: 11:28 + StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:11:26: 11:27 goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6 } diff --git a/src/test/mir-opt/simplify-arm/rustc.id.SimplifyBranchSame.diff b/src/test/mir-opt/simplify-arm/rustc.id.SimplifyBranchSame.diff index 15bd5e7c9f0b..cd5962c682a5 100644 --- a/src/test/mir-opt/simplify-arm/rustc.id.SimplifyBranchSame.diff +++ b/src/test/mir-opt/simplify-arm/rustc.id.SimplifyBranchSame.diff @@ -33,7 +33,7 @@ ((_0 as Some).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27 discriminant(_0) = 1; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27 StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:11:26: 11:27 - StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:11:27: 11:28 + StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:11:26: 11:27 goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6 } diff --git a/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyArmIdentity.diff index 37273d1d6517..642ccc1ab14b 100644 --- a/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyArmIdentity.diff @@ -29,7 +29,7 @@ ((_0 as Err).0: i32) = move _6; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25 discriminant(_0) = 1; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25 StorageDead(_6); // scope 2 at $DIR/simplify-arm.rs:19:24: 19:25 - StorageDead(_5); // scope 0 at $DIR/simplify-arm.rs:19:25: 19:26 + StorageDead(_5); // scope 0 at $DIR/simplify-arm.rs:19:24: 19:25 goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6 } @@ -45,7 +45,7 @@ ((_0 as Ok).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23 discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23 StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:18:22: 18:23 - StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:18:23: 18:24 + StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:18:22: 18:23 goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6 } diff --git a/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyBranchSame.diff b/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyBranchSame.diff index f138d637435f..95ce09a39ed5 100644 --- a/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyBranchSame.diff +++ b/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyBranchSame.diff @@ -29,7 +29,7 @@ ((_0 as Err).0: i32) = move _6; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25 discriminant(_0) = 1; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25 StorageDead(_6); // scope 2 at $DIR/simplify-arm.rs:19:24: 19:25 - StorageDead(_5); // scope 0 at $DIR/simplify-arm.rs:19:25: 19:26 + StorageDead(_5); // scope 0 at $DIR/simplify-arm.rs:19:24: 19:25 goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6 } @@ -45,7 +45,7 @@ ((_0 as Ok).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23 discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23 StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:18:22: 18:23 - StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:18:23: 18:24 + StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:18:22: 18:23 goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6 } diff --git a/src/test/mir-opt/simplify_try_if_let/rustc.{{impl}}-append.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify_try_if_let/rustc.{{impl}}-append.SimplifyArmIdentity.diff index aa416049f661..4471f4d206ca 100644 --- a/src/test/mir-opt/simplify_try_if_let/rustc.{{impl}}-append.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/simplify_try_if_let/rustc.{{impl}}-append.SimplifyArmIdentity.diff @@ -115,7 +115,7 @@ bb8: { StorageDead(_5); // scope 1 at $DIR/simplify_try_if_let.rs:31:13: 31:14 - StorageDead(_4); // scope 0 at $DIR/simplify_try_if_let.rs:32:9: 32:10 + StorageDead(_4); // scope 0 at $DIR/simplify_try_if_let.rs:31:13: 31:14 goto -> bb9; // scope 0 at $DIR/simplify_try_if_let.rs:21:9: 32:10 } diff --git a/src/test/ui/match/issue-74050-end-span.rs b/src/test/ui/match/issue-74050-end-span.rs new file mode 100644 index 000000000000..cc81214e2701 --- /dev/null +++ b/src/test/ui/match/issue-74050-end-span.rs @@ -0,0 +1,13 @@ +fn main() { + let mut args = std::env::args_os(); + let _arg = match args.next() { + Some(arg) => { + match arg.to_str() { + //~^ ERROR `arg` does not live long enough + Some(s) => s, + None => return, + } + } + None => return, + }; +} diff --git a/src/test/ui/match/issue-74050-end-span.stderr b/src/test/ui/match/issue-74050-end-span.stderr new file mode 100644 index 000000000000..d636a11a91ce --- /dev/null +++ b/src/test/ui/match/issue-74050-end-span.stderr @@ -0,0 +1,15 @@ +error[E0597]: `arg` does not live long enough + --> $DIR/issue-74050-end-span.rs:5:19 + | +LL | let _arg = match args.next() { + | ---- borrow later stored here +LL | Some(arg) => { +LL | match arg.to_str() { + | ^^^ borrowed value does not live long enough +... +LL | } + | - `arg` dropped here while still borrowed + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. From 59f979fa06fed49e02606d4891b5b5e4fc545725 Mon Sep 17 00:00:00 2001 From: Arlo Siemsen Date: Thu, 2 Jul 2020 10:45:10 -0700 Subject: [PATCH 12/15] Fix cross-compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, this change also adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for cross-compilation. --- Cargo.lock | 4 ++-- src/bootstrap/native.rs | 31 +++++++++++++++++++++++-------- src/llvm-project | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cedf44be85bd..37928c4d5581 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", ] diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index cceb79416505..e8ec575ea374 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/llvm-project b/src/llvm-project index 6c040dd86ed6..d134a53927fa 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 6c040dd86ed62d38e585279027486e6efc42fb36 +Subproject commit d134a53927fa033ae7e0f3e8ee872ff2dc71468d From 26353eae4c1454cad27e4af26c664c0048312668 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 8 Jul 2020 08:52:48 -0700 Subject: [PATCH 13/15] Fix x.py test for librustc crates. --- src/bootstrap/test.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 312532558090..1916d96bed71 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1562,7 +1562,7 @@ impl Step for CrateLibrustc { let compiler = builder.compiler(builder.top_stage, run.host); for krate in builder.in_tree_crates("rustc-main") { - if run.path.ends_with(&krate.path) { + if krate.path.ends_with(&run.path) { let test_kind = builder.kind.into(); builder.ensure(CrateLibrustc { @@ -1669,7 +1669,7 @@ impl Step for Crate { }; for krate in builder.in_tree_crates("test") { - if run.path.ends_with(&krate.local_path(&builder)) { + if krate.path.ends_with(&run.path) { make(Mode::Std, krate); } } From 1e567c11686f20b4e7422ba9cc0f1eac45e9c9fb Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Wed, 8 Jul 2020 09:36:52 -0400 Subject: [PATCH 14/15] Avoid "blacklist" Other terms are more inclusive and precise. Clippy still has a lint named "blacklisted-name", but renaming it would be a breaking change, so is left for future work. The target configuration option "abi-blacklist" has been depreciated and renamed to "unsupported-abis". The old name continues to work. --- src/librustc_error_codes/error_codes/E0570.md | 2 +- src/librustc_resolve/imports.rs | 36 ++++++------- src/librustc_resolve/late.rs | 6 +-- src/librustc_resolve/lib.rs | 4 +- src/librustc_target/spec/aarch64_apple_ios.rs | 2 +- .../spec/aarch64_apple_tvos.rs | 2 +- src/librustc_target/spec/aarch64_fuchsia.rs | 2 +- .../spec/aarch64_linux_android.rs | 2 +- .../spec/aarch64_unknown_cloudabi.rs | 2 +- .../spec/aarch64_unknown_freebsd.rs | 2 +- .../spec/aarch64_unknown_hermit.rs | 2 +- .../spec/aarch64_unknown_linux_gnu.rs | 2 +- .../spec/aarch64_unknown_linux_musl.rs | 2 +- .../spec/aarch64_unknown_netbsd.rs | 2 +- .../spec/aarch64_unknown_none.rs | 2 +- .../spec/aarch64_unknown_none_softfloat.rs | 2 +- .../spec/aarch64_unknown_openbsd.rs | 2 +- .../spec/aarch64_wrs_vxworks.rs | 2 +- src/librustc_target/spec/arm_base.rs | 2 +- .../spec/arm_linux_androideabi.rs | 2 +- .../spec/arm_unknown_linux_gnueabi.rs | 2 +- .../spec/arm_unknown_linux_gnueabihf.rs | 2 +- .../spec/arm_unknown_linux_musleabi.rs | 2 +- .../spec/arm_unknown_linux_musleabihf.rs | 2 +- .../spec/armebv7r_none_eabi.rs | 2 +- .../spec/armebv7r_none_eabihf.rs | 2 +- .../spec/armv4t_unknown_linux_gnueabi.rs | 2 +- .../spec/armv5te_unknown_linux_gnueabi.rs | 2 +- .../spec/armv5te_unknown_linux_musleabi.rs | 2 +- .../spec/armv6_unknown_freebsd.rs | 2 +- .../spec/armv6_unknown_netbsd_eabihf.rs | 2 +- src/librustc_target/spec/armv7_apple_ios.rs | 2 +- .../spec/armv7_linux_androideabi.rs | 2 +- .../spec/armv7_unknown_cloudabi_eabihf.rs | 2 +- .../spec/armv7_unknown_freebsd.rs | 2 +- .../spec/armv7_unknown_linux_gnueabi.rs | 2 +- .../spec/armv7_unknown_linux_gnueabihf.rs | 2 +- .../spec/armv7_unknown_linux_musleabi.rs | 2 +- .../spec/armv7_unknown_linux_musleabihf.rs | 2 +- .../spec/armv7_unknown_netbsd_eabihf.rs | 2 +- .../spec/armv7_wrs_vxworks_eabihf.rs | 2 +- src/librustc_target/spec/armv7a_none_eabi.rs | 2 +- .../spec/armv7a_none_eabihf.rs | 2 +- src/librustc_target/spec/armv7r_none_eabi.rs | 2 +- .../spec/armv7r_none_eabihf.rs | 2 +- src/librustc_target/spec/armv7s_apple_ios.rs | 2 +- src/librustc_target/spec/mod.rs | 50 +++++++++++-------- .../spec/nvptx64_nvidia_cuda.rs | 2 +- .../spec/riscv32i_unknown_none_elf.rs | 2 +- .../spec/riscv32imac_unknown_none_elf.rs | 2 +- .../spec/riscv32imc_unknown_none_elf.rs | 2 +- .../spec/riscv64gc_unknown_linux_gnu.rs | 2 +- .../spec/riscv64gc_unknown_none_elf.rs | 2 +- .../spec/riscv64imac_unknown_none_elf.rs | 2 +- src/librustc_target/spec/riscv_base.rs | 2 +- src/librustc_target/spec/thumb_base.rs | 2 +- .../spec/thumbv7a_pc_windows_msvc.rs | 2 +- .../spec/thumbv7a_uwp_windows_msvc.rs | 2 +- .../spec/thumbv7neon_linux_androideabi.rs | 2 +- .../thumbv7neon_unknown_linux_gnueabihf.rs | 2 +- .../thumbv7neon_unknown_linux_musleabihf.rs | 2 +- src/test/ui/issues/issue-29540.rs | 2 +- src/tools/compiletest/src/main.rs | 6 +-- 63 files changed, 111 insertions(+), 107 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0570.md b/src/librustc_error_codes/error_codes/E0570.md index bf9615f87387..355e71ffb432 100644 --- a/src/librustc_error_codes/error_codes/E0570.md +++ b/src/librustc_error_codes/error_codes/E0570.md @@ -1,6 +1,6 @@ The requested ABI is unsupported by the current target. -The rust compiler maintains for each target a blacklist of ABIs unsupported on +The rust compiler maintains for each target a list of unsupported ABIs on that target. If an ABI is present in such a list this usually means that the target / ABI combination is currently unsupported by llvm. diff --git a/src/librustc_resolve/imports.rs b/src/librustc_resolve/imports.rs index ded0ee8a9669..4595a96ce24f 100644 --- a/src/librustc_resolve/imports.rs +++ b/src/librustc_resolve/imports.rs @@ -262,8 +262,8 @@ impl<'a> Resolver<'a> { } let check_usable = |this: &mut Self, binding: &'a NameBinding<'a>| { - if let Some(blacklisted_binding) = this.blacklisted_binding { - if ptr::eq(binding, blacklisted_binding) { + if let Some(unusable_binding) = this.unusable_binding { + if ptr::eq(binding, unusable_binding) { return Err((Determined, Weak::No)); } } @@ -278,12 +278,12 @@ impl<'a> Resolver<'a> { return resolution .binding .and_then(|binding| { - // If the primary binding is blacklisted, search further and return the shadowed - // glob binding if it exists. What we really want here is having two separate - // scopes in a module - one for non-globs and one for globs, but until that's done - // use this hack to avoid inconsistent resolution ICEs during import validation. - if let Some(blacklisted_binding) = self.blacklisted_binding { - if ptr::eq(binding, blacklisted_binding) { + // If the primary binding is unusable, search further and return the shadowed glob + // binding if it exists. What we really want here is having two separate scopes in + // a module - one for non-globs and one for globs, but until that's done use this + // hack to avoid inconsistent resolution ICEs during import validation. + if let Some(unusable_binding) = self.unusable_binding { + if ptr::eq(binding, unusable_binding) { return resolution.shadowed_glob; } } @@ -875,9 +875,9 @@ impl<'a, 'b> ImportResolver<'a, 'b> { /// consolidate multiple unresolved import errors into a single diagnostic. fn finalize_import(&mut self, import: &'b Import<'b>) -> Option { let orig_vis = import.vis.replace(ty::Visibility::Invisible); - let orig_blacklisted_binding = match &import.kind { + let orig_unusable_binding = match &import.kind { ImportKind::Single { target_bindings, .. } => { - Some(mem::replace(&mut self.r.blacklisted_binding, target_bindings[TypeNS].get())) + Some(mem::replace(&mut self.r.unusable_binding, target_bindings[TypeNS].get())) } _ => None, }; @@ -891,8 +891,8 @@ impl<'a, 'b> ImportResolver<'a, 'b> { import.crate_lint(), ); let no_ambiguity = self.r.ambiguity_errors.len() == prev_ambiguity_errors_len; - if let Some(orig_blacklisted_binding) = orig_blacklisted_binding { - self.r.blacklisted_binding = orig_blacklisted_binding; + if let Some(orig_unusable_binding) = orig_unusable_binding { + self.r.unusable_binding = orig_unusable_binding; } import.vis.set(orig_vis); if let PathResult::Failed { .. } | PathResult::NonModule(..) = path_res { @@ -1013,8 +1013,8 @@ impl<'a, 'b> ImportResolver<'a, 'b> { self.r.per_ns(|this, ns| { if !type_ns_only || ns == TypeNS { let orig_vis = import.vis.replace(ty::Visibility::Invisible); - let orig_blacklisted_binding = - mem::replace(&mut this.blacklisted_binding, target_bindings[ns].get()); + let orig_unusable_binding = + mem::replace(&mut this.unusable_binding, target_bindings[ns].get()); let orig_last_import_segment = mem::replace(&mut this.last_import_segment, true); let binding = this.resolve_ident_in_module( module, @@ -1025,7 +1025,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> { import.span, ); this.last_import_segment = orig_last_import_segment; - this.blacklisted_binding = orig_blacklisted_binding; + this.unusable_binding = orig_unusable_binding; import.vis.set(orig_vis); match binding { @@ -1291,8 +1291,8 @@ impl<'a, 'b> ImportResolver<'a, 'b> { return; } - let orig_blacklisted_binding = - mem::replace(&mut this.blacklisted_binding, target_bindings[ns].get()); + let orig_unusable_binding = + mem::replace(&mut this.unusable_binding, target_bindings[ns].get()); match this.early_resolve_ident_in_lexical_scope( target, @@ -1311,7 +1311,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> { Err(_) => is_redundant[ns] = Some(false), } - this.blacklisted_binding = orig_blacklisted_binding; + this.unusable_binding = orig_unusable_binding; } }); diff --git a/src/librustc_resolve/late.rs b/src/librustc_resolve/late.rs index 4451791780ea..679f5637686f 100644 --- a/src/librustc_resolve/late.rs +++ b/src/librustc_resolve/late.rs @@ -842,14 +842,14 @@ impl<'a, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { report_error(self, ns); } Some(LexicalScopeBinding::Item(binding)) => { - let orig_blacklisted_binding = - replace(&mut self.r.blacklisted_binding, Some(binding)); + let orig_unusable_binding = + replace(&mut self.r.unusable_binding, Some(binding)); if let Some(LexicalScopeBinding::Res(..)) = self .resolve_ident_in_lexical_scope(ident, ns, None, use_tree.prefix.span) { report_error(self, ns); } - self.r.blacklisted_binding = orig_blacklisted_binding; + self.r.unusable_binding = orig_unusable_binding; } None => {} } diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index f3a1934abc9f..edc37bac5dc6 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -867,7 +867,7 @@ pub struct Resolver<'a> { last_import_segment: bool, /// This binding should be ignored during in-module resolution, so that we don't get /// "self-confirming" import resolutions during import validation. - blacklisted_binding: Option<&'a NameBinding<'a>>, + unusable_binding: Option<&'a NameBinding<'a>>, /// The idents for the primitive types. primitive_type_table: PrimitiveTypeTable, @@ -1266,7 +1266,7 @@ impl<'a> Resolver<'a> { indeterminate_imports: Vec::new(), last_import_segment: false, - blacklisted_binding: None, + unusable_binding: None, primitive_type_table: PrimitiveTypeTable::new(), diff --git a/src/librustc_target/spec/aarch64_apple_ios.rs b/src/librustc_target/spec/aarch64_apple_ios.rs index 1447716ca848..21dcec8d5e38 100644 --- a/src/librustc_target/spec/aarch64_apple_ios.rs +++ b/src/librustc_target/spec/aarch64_apple_ios.rs @@ -18,7 +18,7 @@ pub fn target() -> TargetResult { features: "+neon,+fp-armv8,+apple-a7".to_string(), eliminate_frame_pointer: false, max_atomic_width: Some(128), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), forces_embed_bitcode: true, // Taken from a clang build on Xcode 11.4.1. // These arguments are not actually invoked - they just have diff --git a/src/librustc_target/spec/aarch64_apple_tvos.rs b/src/librustc_target/spec/aarch64_apple_tvos.rs index 21f660ac8b83..2b0cd6cabf80 100644 --- a/src/librustc_target/spec/aarch64_apple_tvos.rs +++ b/src/librustc_target/spec/aarch64_apple_tvos.rs @@ -18,7 +18,7 @@ pub fn target() -> TargetResult { features: "+neon,+fp-armv8,+apple-a7".to_string(), eliminate_frame_pointer: false, max_atomic_width: Some(128), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), forces_embed_bitcode: true, ..base }, diff --git a/src/librustc_target/spec/aarch64_fuchsia.rs b/src/librustc_target/spec/aarch64_fuchsia.rs index c0d5d575b6eb..aabfe458ca3b 100644 --- a/src/librustc_target/spec/aarch64_fuchsia.rs +++ b/src/librustc_target/spec/aarch64_fuchsia.rs @@ -15,6 +15,6 @@ pub fn target() -> TargetResult { target_env: String::new(), target_vendor: String::new(), linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld), - options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base }, + options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) } diff --git a/src/librustc_target/spec/aarch64_linux_android.rs b/src/librustc_target/spec/aarch64_linux_android.rs index 03fd059d6027..e4ecc7ac2dc8 100644 --- a/src/librustc_target/spec/aarch64_linux_android.rs +++ b/src/librustc_target/spec/aarch64_linux_android.rs @@ -20,6 +20,6 @@ pub fn target() -> TargetResult { target_env: String::new(), target_vendor: "unknown".to_string(), linker_flavor: LinkerFlavor::Gcc, - options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base }, + options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) } diff --git a/src/librustc_target/spec/aarch64_unknown_cloudabi.rs b/src/librustc_target/spec/aarch64_unknown_cloudabi.rs index 714195430676..1278b89c7fde 100644 --- a/src/librustc_target/spec/aarch64_unknown_cloudabi.rs +++ b/src/librustc_target/spec/aarch64_unknown_cloudabi.rs @@ -3,7 +3,7 @@ use crate::spec::{LinkerFlavor, Target, TargetResult}; pub fn target() -> TargetResult { let mut base = super::cloudabi_base::opts(); base.max_atomic_width = Some(128); - base.abi_blacklist = super::arm_base::abi_blacklist(); + base.unsupported_abis = super::arm_base::unsupported_abis(); base.linker = Some("aarch64-unknown-cloudabi-cc".to_string()); Ok(Target { diff --git a/src/librustc_target/spec/aarch64_unknown_freebsd.rs b/src/librustc_target/spec/aarch64_unknown_freebsd.rs index 2177b7a0add3..5ae592c5139c 100644 --- a/src/librustc_target/spec/aarch64_unknown_freebsd.rs +++ b/src/librustc_target/spec/aarch64_unknown_freebsd.rs @@ -15,6 +15,6 @@ pub fn target() -> TargetResult { target_env: String::new(), target_vendor: "unknown".to_string(), linker_flavor: LinkerFlavor::Gcc, - options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base }, + options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) } diff --git a/src/librustc_target/spec/aarch64_unknown_hermit.rs b/src/librustc_target/spec/aarch64_unknown_hermit.rs index 7b020605102b..5f978c03248b 100644 --- a/src/librustc_target/spec/aarch64_unknown_hermit.rs +++ b/src/librustc_target/spec/aarch64_unknown_hermit.rs @@ -3,7 +3,7 @@ use crate::spec::{LinkerFlavor, Target, TargetResult}; pub fn target() -> TargetResult { let mut base = super::hermit_base::opts(); base.max_atomic_width = Some(128); - base.abi_blacklist = super::arm_base::abi_blacklist(); + base.unsupported_abis = super::arm_base::unsupported_abis(); base.linker = Some("aarch64-hermit-gcc".to_string()); Ok(Target { diff --git a/src/librustc_target/spec/aarch64_unknown_linux_gnu.rs b/src/librustc_target/spec/aarch64_unknown_linux_gnu.rs index 81f5fc850158..036162248c76 100644 --- a/src/librustc_target/spec/aarch64_unknown_linux_gnu.rs +++ b/src/librustc_target/spec/aarch64_unknown_linux_gnu.rs @@ -16,7 +16,7 @@ pub fn target() -> TargetResult { target_vendor: "unknown".to_string(), linker_flavor: LinkerFlavor::Gcc, options: TargetOptions { - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}_mcount".to_string(), ..base }, diff --git a/src/librustc_target/spec/aarch64_unknown_linux_musl.rs b/src/librustc_target/spec/aarch64_unknown_linux_musl.rs index 608b9d29b329..dc613f35d1d3 100644 --- a/src/librustc_target/spec/aarch64_unknown_linux_musl.rs +++ b/src/librustc_target/spec/aarch64_unknown_linux_musl.rs @@ -16,7 +16,7 @@ pub fn target() -> TargetResult { target_vendor: "unknown".to_string(), linker_flavor: LinkerFlavor::Gcc, options: TargetOptions { - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}_mcount".to_string(), ..base }, diff --git a/src/librustc_target/spec/aarch64_unknown_netbsd.rs b/src/librustc_target/spec/aarch64_unknown_netbsd.rs index b06a2a906697..8c2f6fcff730 100644 --- a/src/librustc_target/spec/aarch64_unknown_netbsd.rs +++ b/src/librustc_target/spec/aarch64_unknown_netbsd.rs @@ -3,7 +3,7 @@ use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; pub fn target() -> TargetResult { let mut base = super::netbsd_base::opts(); base.max_atomic_width = Some(128); - base.abi_blacklist = super::arm_base::abi_blacklist(); + base.unsupported_abis = super::arm_base::unsupported_abis(); Ok(Target { llvm_target: "aarch64-unknown-netbsd".to_string(), diff --git a/src/librustc_target/spec/aarch64_unknown_none.rs b/src/librustc_target/spec/aarch64_unknown_none.rs index 7177c4e251e7..e012dce73fec 100644 --- a/src/librustc_target/spec/aarch64_unknown_none.rs +++ b/src/librustc_target/spec/aarch64_unknown_none.rs @@ -18,7 +18,7 @@ pub fn target() -> Result { linker_is_gnu: true, max_atomic_width: Some(128), panic_strategy: PanicStrategy::Abort, - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), ..Default::default() }; Ok(Target { diff --git a/src/librustc_target/spec/aarch64_unknown_none_softfloat.rs b/src/librustc_target/spec/aarch64_unknown_none_softfloat.rs index 986300c677df..e2aa6e3b8f52 100644 --- a/src/librustc_target/spec/aarch64_unknown_none_softfloat.rs +++ b/src/librustc_target/spec/aarch64_unknown_none_softfloat.rs @@ -18,7 +18,7 @@ pub fn target() -> Result { linker_is_gnu: true, max_atomic_width: Some(128), panic_strategy: PanicStrategy::Abort, - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), ..Default::default() }; Ok(Target { diff --git a/src/librustc_target/spec/aarch64_unknown_openbsd.rs b/src/librustc_target/spec/aarch64_unknown_openbsd.rs index c9cd64c3a84a..fd726c70f496 100644 --- a/src/librustc_target/spec/aarch64_unknown_openbsd.rs +++ b/src/librustc_target/spec/aarch64_unknown_openbsd.rs @@ -3,7 +3,7 @@ use crate::spec::{LinkerFlavor, Target, TargetResult}; pub fn target() -> TargetResult { let mut base = super::openbsd_base::opts(); base.max_atomic_width = Some(128); - base.abi_blacklist = super::arm_base::abi_blacklist(); + base.unsupported_abis = super::arm_base::unsupported_abis(); Ok(Target { llvm_target: "aarch64-unknown-openbsd".to_string(), diff --git a/src/librustc_target/spec/aarch64_wrs_vxworks.rs b/src/librustc_target/spec/aarch64_wrs_vxworks.rs index 47b003b71144..05f5d7d3a8b4 100644 --- a/src/librustc_target/spec/aarch64_wrs_vxworks.rs +++ b/src/librustc_target/spec/aarch64_wrs_vxworks.rs @@ -15,6 +15,6 @@ pub fn target() -> TargetResult { target_env: "gnu".to_string(), target_vendor: "wrs".to_string(), linker_flavor: LinkerFlavor::Gcc, - options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base }, + options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) } diff --git a/src/librustc_target/spec/arm_base.rs b/src/librustc_target/spec/arm_base.rs index 77e7bfac62d5..b74d80dc6bb2 100644 --- a/src/librustc_target/spec/arm_base.rs +++ b/src/librustc_target/spec/arm_base.rs @@ -1,6 +1,6 @@ use crate::spec::abi::Abi; // All the calling conventions trigger an assertion(Unsupported calling convention) in llvm on arm -pub fn abi_blacklist() -> Vec { +pub fn unsupported_abis() -> Vec { vec![Abi::Stdcall, Abi::Fastcall, Abi::Vectorcall, Abi::Thiscall, Abi::Win64, Abi::SysV64] } diff --git a/src/librustc_target/spec/arm_linux_androideabi.rs b/src/librustc_target/spec/arm_linux_androideabi.rs index 5dc6eaca9194..7109d043f519 100644 --- a/src/librustc_target/spec/arm_linux_androideabi.rs +++ b/src/librustc_target/spec/arm_linux_androideabi.rs @@ -17,6 +17,6 @@ pub fn target() -> TargetResult { target_env: String::new(), target_vendor: "unknown".to_string(), linker_flavor: LinkerFlavor::Gcc, - options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base }, + options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) } diff --git a/src/librustc_target/spec/arm_unknown_linux_gnueabi.rs b/src/librustc_target/spec/arm_unknown_linux_gnueabi.rs index ead483df155a..2e3bad83e255 100644 --- a/src/librustc_target/spec/arm_unknown_linux_gnueabi.rs +++ b/src/librustc_target/spec/arm_unknown_linux_gnueabi.rs @@ -17,7 +17,7 @@ pub fn target() -> TargetResult { options: TargetOptions { features: "+strict-align,+v6".to_string(), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}__gnu_mcount_nc".to_string(), ..base }, diff --git a/src/librustc_target/spec/arm_unknown_linux_gnueabihf.rs b/src/librustc_target/spec/arm_unknown_linux_gnueabihf.rs index 53d2e9a46d08..f8e357cce663 100644 --- a/src/librustc_target/spec/arm_unknown_linux_gnueabihf.rs +++ b/src/librustc_target/spec/arm_unknown_linux_gnueabihf.rs @@ -17,7 +17,7 @@ pub fn target() -> TargetResult { options: TargetOptions { features: "+strict-align,+v6,+vfp2,-d32".to_string(), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}__gnu_mcount_nc".to_string(), ..base }, diff --git a/src/librustc_target/spec/arm_unknown_linux_musleabi.rs b/src/librustc_target/spec/arm_unknown_linux_musleabi.rs index 03d191990c39..75753af9f307 100644 --- a/src/librustc_target/spec/arm_unknown_linux_musleabi.rs +++ b/src/librustc_target/spec/arm_unknown_linux_musleabi.rs @@ -22,7 +22,7 @@ pub fn target() -> TargetResult { target_vendor: "unknown".to_string(), linker_flavor: LinkerFlavor::Gcc, options: TargetOptions { - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}mcount".to_string(), ..base }, diff --git a/src/librustc_target/spec/arm_unknown_linux_musleabihf.rs b/src/librustc_target/spec/arm_unknown_linux_musleabihf.rs index bd92f0f43471..c74c88e36125 100644 --- a/src/librustc_target/spec/arm_unknown_linux_musleabihf.rs +++ b/src/librustc_target/spec/arm_unknown_linux_musleabihf.rs @@ -22,7 +22,7 @@ pub fn target() -> TargetResult { target_vendor: "unknown".to_string(), linker_flavor: LinkerFlavor::Gcc, options: TargetOptions { - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}mcount".to_string(), ..base }, diff --git a/src/librustc_target/spec/armebv7r_none_eabi.rs b/src/librustc_target/spec/armebv7r_none_eabi.rs index a1f68f6706a2..e0d1f2653ce0 100644 --- a/src/librustc_target/spec/armebv7r_none_eabi.rs +++ b/src/librustc_target/spec/armebv7r_none_eabi.rs @@ -22,7 +22,7 @@ pub fn target() -> TargetResult { relocation_model: RelocModel::Static, panic_strategy: PanicStrategy::Abort, max_atomic_width: Some(32), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), emit_debug_gdb_scripts: false, ..Default::default() }, diff --git a/src/librustc_target/spec/armebv7r_none_eabihf.rs b/src/librustc_target/spec/armebv7r_none_eabihf.rs index 4d81c21f52a7..e2d37d45bf14 100644 --- a/src/librustc_target/spec/armebv7r_none_eabihf.rs +++ b/src/librustc_target/spec/armebv7r_none_eabihf.rs @@ -23,7 +23,7 @@ pub fn target() -> TargetResult { panic_strategy: PanicStrategy::Abort, features: "+vfp3,-d32,-fp16".to_string(), max_atomic_width: Some(32), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), emit_debug_gdb_scripts: false, ..Default::default() }, diff --git a/src/librustc_target/spec/armv4t_unknown_linux_gnueabi.rs b/src/librustc_target/spec/armv4t_unknown_linux_gnueabi.rs index 60f822a02947..2580e8b0f851 100644 --- a/src/librustc_target/spec/armv4t_unknown_linux_gnueabi.rs +++ b/src/librustc_target/spec/armv4t_unknown_linux_gnueabi.rs @@ -18,7 +18,7 @@ pub fn target() -> TargetResult { features: "+soft-float,+strict-align".to_string(), // Atomic operations provided by compiler-builtins max_atomic_width: Some(32), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}__gnu_mcount_nc".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv5te_unknown_linux_gnueabi.rs b/src/librustc_target/spec/armv5te_unknown_linux_gnueabi.rs index 9fa0f609c748..f28421dc7759 100644 --- a/src/librustc_target/spec/armv5te_unknown_linux_gnueabi.rs +++ b/src/librustc_target/spec/armv5te_unknown_linux_gnueabi.rs @@ -18,7 +18,7 @@ pub fn target() -> TargetResult { features: "+soft-float,+strict-align".to_string(), // Atomic operations provided by compiler-builtins max_atomic_width: Some(32), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}__gnu_mcount_nc".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv5te_unknown_linux_musleabi.rs b/src/librustc_target/spec/armv5te_unknown_linux_musleabi.rs index bb19eb455cd3..fe1fa88883d3 100644 --- a/src/librustc_target/spec/armv5te_unknown_linux_musleabi.rs +++ b/src/librustc_target/spec/armv5te_unknown_linux_musleabi.rs @@ -21,7 +21,7 @@ pub fn target() -> TargetResult { features: "+soft-float,+strict-align".to_string(), // Atomic operations provided by compiler-builtins max_atomic_width: Some(32), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}mcount".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv6_unknown_freebsd.rs b/src/librustc_target/spec/armv6_unknown_freebsd.rs index bbab1c60b135..1e06f837997a 100644 --- a/src/librustc_target/spec/armv6_unknown_freebsd.rs +++ b/src/librustc_target/spec/armv6_unknown_freebsd.rs @@ -17,7 +17,7 @@ pub fn target() -> TargetResult { options: TargetOptions { features: "+v6,+vfp2,-d32".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}__gnu_mcount_nc".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv6_unknown_netbsd_eabihf.rs b/src/librustc_target/spec/armv6_unknown_netbsd_eabihf.rs index 4332d1498e7f..ef40085888c8 100644 --- a/src/librustc_target/spec/armv6_unknown_netbsd_eabihf.rs +++ b/src/librustc_target/spec/armv6_unknown_netbsd_eabihf.rs @@ -17,7 +17,7 @@ pub fn target() -> TargetResult { options: TargetOptions { features: "+v6,+vfp2,-d32".to_string(), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "__mcount".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv7_apple_ios.rs b/src/librustc_target/spec/armv7_apple_ios.rs index c0c2ae909f8f..393843526a8c 100644 --- a/src/librustc_target/spec/armv7_apple_ios.rs +++ b/src/librustc_target/spec/armv7_apple_ios.rs @@ -17,7 +17,7 @@ pub fn target() -> TargetResult { options: TargetOptions { features: "+v7,+vfp3,+neon".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) diff --git a/src/librustc_target/spec/armv7_linux_androideabi.rs b/src/librustc_target/spec/armv7_linux_androideabi.rs index 38d854163ecb..38c6c31bd10d 100644 --- a/src/librustc_target/spec/armv7_linux_androideabi.rs +++ b/src/librustc_target/spec/armv7_linux_androideabi.rs @@ -25,6 +25,6 @@ pub fn target() -> TargetResult { target_env: String::new(), target_vendor: "unknown".to_string(), linker_flavor: LinkerFlavor::Gcc, - options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base }, + options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) } diff --git a/src/librustc_target/spec/armv7_unknown_cloudabi_eabihf.rs b/src/librustc_target/spec/armv7_unknown_cloudabi_eabihf.rs index 7d34f5c63bfa..e3f4fe0b2efb 100644 --- a/src/librustc_target/spec/armv7_unknown_cloudabi_eabihf.rs +++ b/src/librustc_target/spec/armv7_unknown_cloudabi_eabihf.rs @@ -5,7 +5,7 @@ pub fn target() -> TargetResult { base.cpu = "cortex-a8".to_string(); base.max_atomic_width = Some(64); base.features = "+v7,+vfp3,+neon".to_string(); - base.abi_blacklist = super::arm_base::abi_blacklist(); + base.unsupported_abis = super::arm_base::unsupported_abis(); base.linker = Some("armv7-unknown-cloudabi-eabihf-cc".to_string()); Ok(Target { diff --git a/src/librustc_target/spec/armv7_unknown_freebsd.rs b/src/librustc_target/spec/armv7_unknown_freebsd.rs index e747ddca58a8..80a9e6d7e3c8 100644 --- a/src/librustc_target/spec/armv7_unknown_freebsd.rs +++ b/src/librustc_target/spec/armv7_unknown_freebsd.rs @@ -17,7 +17,7 @@ pub fn target() -> TargetResult { options: TargetOptions { features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}__gnu_mcount_nc".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv7_unknown_linux_gnueabi.rs b/src/librustc_target/spec/armv7_unknown_linux_gnueabi.rs index c887bdf2a102..0f175e9aef5e 100644 --- a/src/librustc_target/spec/armv7_unknown_linux_gnueabi.rs +++ b/src/librustc_target/spec/armv7_unknown_linux_gnueabi.rs @@ -21,7 +21,7 @@ pub fn target() -> TargetResult { features: "+v7,+thumb2,+soft-float,-neon".to_string(), cpu: "generic".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}__gnu_mcount_nc".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv7_unknown_linux_gnueabihf.rs b/src/librustc_target/spec/armv7_unknown_linux_gnueabihf.rs index 4ebc3416156b..27923457cd16 100644 --- a/src/librustc_target/spec/armv7_unknown_linux_gnueabihf.rs +++ b/src/librustc_target/spec/armv7_unknown_linux_gnueabihf.rs @@ -22,7 +22,7 @@ pub fn target() -> TargetResult { features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(), cpu: "generic".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}__gnu_mcount_nc".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv7_unknown_linux_musleabi.rs b/src/librustc_target/spec/armv7_unknown_linux_musleabi.rs index bee3e2604adf..3d1bf05237fd 100644 --- a/src/librustc_target/spec/armv7_unknown_linux_musleabi.rs +++ b/src/librustc_target/spec/armv7_unknown_linux_musleabi.rs @@ -26,7 +26,7 @@ pub fn target() -> TargetResult { features: "+v7,+thumb2,+soft-float,-neon".to_string(), cpu: "generic".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}mcount".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv7_unknown_linux_musleabihf.rs b/src/librustc_target/spec/armv7_unknown_linux_musleabihf.rs index c3cfeca7f27b..03d7d88b0d6d 100644 --- a/src/librustc_target/spec/armv7_unknown_linux_musleabihf.rs +++ b/src/librustc_target/spec/armv7_unknown_linux_musleabihf.rs @@ -25,7 +25,7 @@ pub fn target() -> TargetResult { features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(), cpu: "generic".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}mcount".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv7_unknown_netbsd_eabihf.rs b/src/librustc_target/spec/armv7_unknown_netbsd_eabihf.rs index 9d382fe04be2..18fc9ed2ec63 100644 --- a/src/librustc_target/spec/armv7_unknown_netbsd_eabihf.rs +++ b/src/librustc_target/spec/armv7_unknown_netbsd_eabihf.rs @@ -18,7 +18,7 @@ pub fn target() -> TargetResult { features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(), cpu: "generic".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "__mcount".to_string(), ..base }, diff --git a/src/librustc_target/spec/armv7_wrs_vxworks_eabihf.rs b/src/librustc_target/spec/armv7_wrs_vxworks_eabihf.rs index 34eb04ea83e1..04d8702471af 100644 --- a/src/librustc_target/spec/armv7_wrs_vxworks_eabihf.rs +++ b/src/librustc_target/spec/armv7_wrs_vxworks_eabihf.rs @@ -18,7 +18,7 @@ pub fn target() -> TargetResult { features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(), cpu: "generic".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) diff --git a/src/librustc_target/spec/armv7a_none_eabi.rs b/src/librustc_target/spec/armv7a_none_eabi.rs index 09f1494e81cd..1db279defff3 100644 --- a/src/librustc_target/spec/armv7a_none_eabi.rs +++ b/src/librustc_target/spec/armv7a_none_eabi.rs @@ -28,7 +28,7 @@ pub fn target() -> Result { disable_redzone: true, max_atomic_width: Some(64), panic_strategy: PanicStrategy::Abort, - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), emit_debug_gdb_scripts: false, ..Default::default() }; diff --git a/src/librustc_target/spec/armv7a_none_eabihf.rs b/src/librustc_target/spec/armv7a_none_eabihf.rs index 653ca76435bc..22c2b306b43b 100644 --- a/src/librustc_target/spec/armv7a_none_eabihf.rs +++ b/src/librustc_target/spec/armv7a_none_eabihf.rs @@ -16,7 +16,7 @@ pub fn target() -> Result { disable_redzone: true, max_atomic_width: Some(64), panic_strategy: PanicStrategy::Abort, - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), emit_debug_gdb_scripts: false, ..Default::default() }; diff --git a/src/librustc_target/spec/armv7r_none_eabi.rs b/src/librustc_target/spec/armv7r_none_eabi.rs index 29dfa1703973..fed83997190a 100644 --- a/src/librustc_target/spec/armv7r_none_eabi.rs +++ b/src/librustc_target/spec/armv7r_none_eabi.rs @@ -22,7 +22,7 @@ pub fn target() -> TargetResult { relocation_model: RelocModel::Static, panic_strategy: PanicStrategy::Abort, max_atomic_width: Some(32), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), emit_debug_gdb_scripts: false, ..Default::default() }, diff --git a/src/librustc_target/spec/armv7r_none_eabihf.rs b/src/librustc_target/spec/armv7r_none_eabihf.rs index e6b0187c3313..769ac13e5150 100644 --- a/src/librustc_target/spec/armv7r_none_eabihf.rs +++ b/src/librustc_target/spec/armv7r_none_eabihf.rs @@ -23,7 +23,7 @@ pub fn target() -> TargetResult { panic_strategy: PanicStrategy::Abort, features: "+vfp3,-d32,-fp16".to_string(), max_atomic_width: Some(32), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), emit_debug_gdb_scripts: false, ..Default::default() }, diff --git a/src/librustc_target/spec/armv7s_apple_ios.rs b/src/librustc_target/spec/armv7s_apple_ios.rs index 6a5654f10d41..998a7b2e1648 100644 --- a/src/librustc_target/spec/armv7s_apple_ios.rs +++ b/src/librustc_target/spec/armv7s_apple_ios.rs @@ -17,7 +17,7 @@ pub fn target() -> TargetResult { options: TargetOptions { features: "+v7,+vfp4,+neon".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs index 29250f21383b..4a2dd8913185 100644 --- a/src/librustc_target/spec/mod.rs +++ b/src/librustc_target/spec/mod.rs @@ -902,9 +902,10 @@ pub struct TargetOptions { /// Panic strategy: "unwind" or "abort" pub panic_strategy: PanicStrategy, - /// A blacklist of ABIs unsupported by the current target. Note that generic - /// ABIs are considered to be supported on all platforms and cannot be blacklisted. - pub abi_blacklist: Vec, + /// A list of ABIs unsupported by the current target. Note that generic ABIs + /// are considered to be supported on all platforms and cannot be marked + /// unsupported. + pub unsupported_abis: Vec, /// Whether or not linking dylibs to a static CRT is allowed. pub crt_static_allows_dylibs: bool, @@ -1056,7 +1057,7 @@ impl Default for TargetOptions { max_atomic_width: None, atomic_cas: true, panic_strategy: PanicStrategy::Unwind, - abi_blacklist: vec![], + unsupported_abis: vec![], crt_static_allows_dylibs: false, crt_static_default: false, crt_static_respected: false, @@ -1125,7 +1126,7 @@ impl Target { } pub fn is_abi_supported(&self, abi: Abi) -> bool { - abi.generic() || !self.options.abi_blacklist.contains(&abi) + abi.generic() || !self.options.unsupported_abis.contains(&abi) } /// Loads a target descriptor from a JSON object. @@ -1474,22 +1475,29 @@ impl Target { key!(llvm_args, list); key!(use_ctors_section, bool); - if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) { - for name in array.iter().filter_map(|abi| abi.as_string()) { - match lookup_abi(name) { - Some(abi) => { - if abi.generic() { + // NB: The old name is deprecated, but support for it is retained for + // compatibility. + for name in ["abi-blacklist", "unsupported-abis"].iter() { + if let Some(array) = obj.find(name).and_then(Json::as_array) { + for name in array.iter().filter_map(|abi| abi.as_string()) { + match lookup_abi(name) { + Some(abi) => { + if abi.generic() { + return Err(format!( + "The ABI \"{}\" is considered to be supported on all \ + targets and cannot be marked unsupported", + abi + )); + } + + base.options.unsupported_abis.push(abi) + } + None => { return Err(format!( - "The ABI \"{}\" is considered to be supported on \ - all targets and cannot be blacklisted", - abi + "Unknown ABI \"{}\" in target specification", + name )); } - - base.options.abi_blacklist.push(abi) - } - None => { - return Err(format!("Unknown ABI \"{}\" in target specification", name)); } } } @@ -1705,11 +1713,11 @@ impl ToJson for Target { target_option_val!(llvm_args); target_option_val!(use_ctors_section); - if default.abi_blacklist != self.options.abi_blacklist { + if default.unsupported_abis != self.options.unsupported_abis { d.insert( - "abi-blacklist".to_string(), + "unsupported-abis".to_string(), self.options - .abi_blacklist + .unsupported_abis .iter() .map(|&name| Abi::name(name).to_json()) .collect::>() diff --git a/src/librustc_target/spec/nvptx64_nvidia_cuda.rs b/src/librustc_target/spec/nvptx64_nvidia_cuda.rs index e0a402533e77..0c8f2a34301e 100644 --- a/src/librustc_target/spec/nvptx64_nvidia_cuda.rs +++ b/src/librustc_target/spec/nvptx64_nvidia_cuda.rs @@ -55,7 +55,7 @@ pub fn target() -> TargetResult { // FIXME: enable compilation tests for the target and // create the tests for this. - abi_blacklist: vec![ + unsupported_abis: vec![ Abi::Cdecl, Abi::Stdcall, Abi::Fastcall, diff --git a/src/librustc_target/spec/riscv32i_unknown_none_elf.rs b/src/librustc_target/spec/riscv32i_unknown_none_elf.rs index d7b3e7e15307..977aa896f252 100644 --- a/src/librustc_target/spec/riscv32i_unknown_none_elf.rs +++ b/src/librustc_target/spec/riscv32i_unknown_none_elf.rs @@ -24,7 +24,7 @@ pub fn target() -> TargetResult { panic_strategy: PanicStrategy::Abort, relocation_model: RelocModel::Static, emit_debug_gdb_scripts: false, - abi_blacklist: super::riscv_base::abi_blacklist(), + unsupported_abis: super::riscv_base::unsupported_abis(), ..Default::default() }, }) diff --git a/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs b/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs index b93b6fcf8002..1a85cdff1315 100644 --- a/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs +++ b/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs @@ -24,7 +24,7 @@ pub fn target() -> TargetResult { panic_strategy: PanicStrategy::Abort, relocation_model: RelocModel::Static, emit_debug_gdb_scripts: false, - abi_blacklist: super::riscv_base::abi_blacklist(), + unsupported_abis: super::riscv_base::unsupported_abis(), ..Default::default() }, }) diff --git a/src/librustc_target/spec/riscv32imc_unknown_none_elf.rs b/src/librustc_target/spec/riscv32imc_unknown_none_elf.rs index a16e7e31c661..e3c1c6908a23 100644 --- a/src/librustc_target/spec/riscv32imc_unknown_none_elf.rs +++ b/src/librustc_target/spec/riscv32imc_unknown_none_elf.rs @@ -24,7 +24,7 @@ pub fn target() -> TargetResult { panic_strategy: PanicStrategy::Abort, relocation_model: RelocModel::Static, emit_debug_gdb_scripts: false, - abi_blacklist: super::riscv_base::abi_blacklist(), + unsupported_abis: super::riscv_base::unsupported_abis(), ..Default::default() }, }) diff --git a/src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs b/src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs index 715449d74ce2..f7a93c916d1d 100644 --- a/src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs +++ b/src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs @@ -13,7 +13,7 @@ pub fn target() -> TargetResult { target_vendor: "unknown".to_string(), linker_flavor: LinkerFlavor::Gcc, options: TargetOptions { - abi_blacklist: super::riscv_base::abi_blacklist(), + unsupported_abis: super::riscv_base::unsupported_abis(), code_model: Some(CodeModel::Medium), cpu: "generic-rv64".to_string(), features: "+m,+a,+f,+d,+c".to_string(), diff --git a/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs b/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs index e5147a12ed32..857af4ceb0d9 100644 --- a/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs +++ b/src/librustc_target/spec/riscv64gc_unknown_none_elf.rs @@ -25,7 +25,7 @@ pub fn target() -> TargetResult { relocation_model: RelocModel::Static, code_model: Some(CodeModel::Medium), emit_debug_gdb_scripts: false, - abi_blacklist: super::riscv_base::abi_blacklist(), + unsupported_abis: super::riscv_base::unsupported_abis(), ..Default::default() }, }) diff --git a/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs b/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs index dc056b55b386..36fe7730f95b 100644 --- a/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs +++ b/src/librustc_target/spec/riscv64imac_unknown_none_elf.rs @@ -25,7 +25,7 @@ pub fn target() -> TargetResult { relocation_model: RelocModel::Static, code_model: Some(CodeModel::Medium), emit_debug_gdb_scripts: false, - abi_blacklist: super::riscv_base::abi_blacklist(), + unsupported_abis: super::riscv_base::unsupported_abis(), ..Default::default() }, }) diff --git a/src/librustc_target/spec/riscv_base.rs b/src/librustc_target/spec/riscv_base.rs index ec1dc9b4918b..64cf890037e5 100644 --- a/src/librustc_target/spec/riscv_base.rs +++ b/src/librustc_target/spec/riscv_base.rs @@ -2,7 +2,7 @@ use crate::spec::abi::Abi; // All the calling conventions trigger an assertion(Unsupported calling // convention) in llvm on RISCV -pub fn abi_blacklist() -> Vec { +pub fn unsupported_abis() -> Vec { vec![ Abi::Cdecl, Abi::Stdcall, diff --git a/src/librustc_target/spec/thumb_base.rs b/src/librustc_target/spec/thumb_base.rs index 646a149a3362..2f7d15d5856f 100644 --- a/src/librustc_target/spec/thumb_base.rs +++ b/src/librustc_target/spec/thumb_base.rs @@ -41,7 +41,7 @@ pub fn opts() -> TargetOptions { // Similarly, one almost always never wants to use relocatable code because of the extra // costs it involves. relocation_model: RelocModel::Static, - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), // When this section is added a volatile load to its start address is also generated. This // volatile load is a footgun as it can end up loading an invalid memory address, depending // on how the user set up their linker scripts. This section adds pretty printer for stuff diff --git a/src/librustc_target/spec/thumbv7a_pc_windows_msvc.rs b/src/librustc_target/spec/thumbv7a_pc_windows_msvc.rs index 21d62d252e09..37828026fe11 100644 --- a/src/librustc_target/spec/thumbv7a_pc_windows_msvc.rs +++ b/src/librustc_target/spec/thumbv7a_pc_windows_msvc.rs @@ -37,7 +37,7 @@ pub fn target() -> TargetResult { features: "+vfp3,+neon".to_string(), cpu: "generic".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) diff --git a/src/librustc_target/spec/thumbv7a_uwp_windows_msvc.rs b/src/librustc_target/spec/thumbv7a_uwp_windows_msvc.rs index ff2e89210060..29a4a9875e5b 100644 --- a/src/librustc_target/spec/thumbv7a_uwp_windows_msvc.rs +++ b/src/librustc_target/spec/thumbv7a_uwp_windows_msvc.rs @@ -23,7 +23,7 @@ pub fn target() -> TargetResult { options: TargetOptions { features: "+vfp3,+neon".to_string(), cpu: "generic".to_string(), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) diff --git a/src/librustc_target/spec/thumbv7neon_linux_androideabi.rs b/src/librustc_target/spec/thumbv7neon_linux_androideabi.rs index 02ad9ab7d9a8..c52f077f6f16 100644 --- a/src/librustc_target/spec/thumbv7neon_linux_androideabi.rs +++ b/src/librustc_target/spec/thumbv7neon_linux_androideabi.rs @@ -25,6 +25,6 @@ pub fn target() -> TargetResult { target_env: "".to_string(), target_vendor: "unknown".to_string(), linker_flavor: LinkerFlavor::Gcc, - options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base }, + options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) } diff --git a/src/librustc_target/spec/thumbv7neon_unknown_linux_gnueabihf.rs b/src/librustc_target/spec/thumbv7neon_unknown_linux_gnueabihf.rs index 04e051485a93..78936948e642 100644 --- a/src/librustc_target/spec/thumbv7neon_unknown_linux_gnueabihf.rs +++ b/src/librustc_target/spec/thumbv7neon_unknown_linux_gnueabihf.rs @@ -25,7 +25,7 @@ pub fn target() -> TargetResult { features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".to_string(), cpu: "generic".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), ..base }, }) diff --git a/src/librustc_target/spec/thumbv7neon_unknown_linux_musleabihf.rs b/src/librustc_target/spec/thumbv7neon_unknown_linux_musleabihf.rs index 3d39a405a411..f759c3eeb011 100644 --- a/src/librustc_target/spec/thumbv7neon_unknown_linux_musleabihf.rs +++ b/src/librustc_target/spec/thumbv7neon_unknown_linux_musleabihf.rs @@ -29,7 +29,7 @@ pub fn target() -> TargetResult { features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".to_string(), cpu: "generic".to_string(), max_atomic_width: Some(64), - abi_blacklist: super::arm_base::abi_blacklist(), + unsupported_abis: super::arm_base::unsupported_abis(), target_mcount: "\u{1}mcount".to_string(), ..base }, diff --git a/src/test/ui/issues/issue-29540.rs b/src/test/ui/issues/issue-29540.rs index 2a4d50f613cd..c0de20822bac 100644 --- a/src/test/ui/issues/issue-29540.rs +++ b/src/test/ui/issues/issue-29540.rs @@ -283,7 +283,7 @@ pub struct Config { pub mds_beacon_interval: String, pub mds_beacon_grace: String, pub mds_enforce_unique_name: String, - pub mds_blacklist_interval: String, + pub mds_interval: String, pub mds_session_timeout: String, pub mds_freeze_tree_timeout: String, pub mds_session_autoclose: String, diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index 2aea4d22700f..97272f1a9c1b 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -401,7 +401,7 @@ fn configure_lldb(config: &Config) -> Option { } if let Some(lldb_version) = config.lldb_version.as_ref() { - if is_blacklisted_lldb_version(&lldb_version) { + if lldb_version == "350" { println!( "WARNING: The used version of LLDB ({}) has a \ known issue that breaks debuginfo tests. See \ @@ -979,7 +979,3 @@ fn extract_lldb_version(full_version_line: Option) -> (Option, b } (None, false) } - -fn is_blacklisted_lldb_version(version: &str) -> bool { - version == "350" -} From 723872639995246b586473867ded975465e1466f Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 8 Jul 2020 10:44:29 -0700 Subject: [PATCH 15/15] Fix librustc_errors unit tests. --- src/librustc_errors/json/tests.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_errors/json/tests.rs b/src/librustc_errors/json/tests.rs index 35912901d688..a2ed6ad6f350 100644 --- a/src/librustc_errors/json/tests.rs +++ b/src/librustc_errors/json/tests.rs @@ -59,6 +59,7 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) { sm, true, HumanReadableErrorType::Short(ColorConfig::Never), + None, false, );