From f9b492f2d03f5fba106b0c9f7d5e723406269f3e Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Wed, 23 Jan 2019 11:21:24 +0100 Subject: [PATCH 1/4] make sure to accept all android licenses --- src/ci/docker/scripts/android-sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/scripts/android-sdk.sh b/src/ci/docker/scripts/android-sdk.sh index e06c57fbab90c..179f63fc830a6 100644 --- a/src/ci/docker/scripts/android-sdk.sh +++ b/src/ci/docker/scripts/android-sdk.sh @@ -20,7 +20,7 @@ download_sysimage() { # The output from sdkmanager is so noisy that it will occupy all of the 4 MB # log extremely quickly. Thus we must silence all output. yes | sdkmanager --licenses > /dev/null - sdkmanager platform-tools emulator \ + yes | sdkmanager platform-tools emulator \ "platforms;android-$api" \ "system-images;android-$api;default;$abi" > /dev/null } From dc52f0f8ab6172b13e5e6eb9a210b120cf5b8d3f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 22 Jan 2019 11:13:53 -0700 Subject: [PATCH 2/4] Fix issue 57762 Issue 57762 points out a compiler crash when the compiler was built using a stock LLVM 7. LLVM 7 was released without a necessary fix for a bug in the DWARF discriminant code. This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. Closes #57762 --- src/librustc_codegen_llvm/debuginfo/metadata.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs index 6deedd0b5ea33..a354eef6887ae 100644 --- a/src/librustc_codegen_llvm/debuginfo/metadata.rs +++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs @@ -1164,7 +1164,11 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool { // On MSVC we have to use the fallback mode, because LLVM doesn't // lower variant parts to PDB. return cx.sess().target.target.options.is_like_msvc - || llvm_util::get_major_version() < 7; + || llvm_util::get_major_version() < 7 + // LLVM version 7 did not release with an important bug fix; + // but the required patch is in the equivalent Rust LLVM. + // See https://github.com/rust-lang/rust/issues/57762. + || (llvm_util::get_major_version() == 7 && unsafe { !llvm::LLVMRustIsRustLLVM() }); } // Describes the members of an enum value: An enum is described as a union of From 676ade5dd9bf026660316bd96d3f8512bde4f025 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 22 Jan 2019 11:44:23 -0700 Subject: [PATCH 3/4] Simplify the version check Address the review comments by simplifying the version check to just "< 8". --- src/librustc_codegen_llvm/debuginfo/metadata.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs index a354eef6887ae..9f63038c3623b 100644 --- a/src/librustc_codegen_llvm/debuginfo/metadata.rs +++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs @@ -1164,11 +1164,10 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool { // On MSVC we have to use the fallback mode, because LLVM doesn't // lower variant parts to PDB. return cx.sess().target.target.options.is_like_msvc - || llvm_util::get_major_version() < 7 // LLVM version 7 did not release with an important bug fix; - // but the required patch is in the equivalent Rust LLVM. - // See https://github.com/rust-lang/rust/issues/57762. - || (llvm_util::get_major_version() == 7 && unsafe { !llvm::LLVMRustIsRustLLVM() }); + // but the required patch is in the LLVM 8. Rust LLVM reports + // 8 as well. + || llvm_util::get_major_version() < 8; } // Describes the members of an enum value: An enum is described as a union of From 1652c7df2386f2e8ec523d13da6948ba2ea97aef Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Thu, 17 Jan 2019 15:32:05 +0100 Subject: [PATCH 4/4] Fix typo bug in DepGraph::try_mark_green(). --- src/librustc/dep_graph/graph.rs | 2 +- .../incremental/change_name_of_static_in_fn.rs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/test/incremental/change_name_of_static_in_fn.rs diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs index 501ef01d74c6e..7384af108edbb 100644 --- a/src/librustc/dep_graph/graph.rs +++ b/src/librustc/dep_graph/graph.rs @@ -600,7 +600,7 @@ impl DepGraph { DepKind::Hir | DepKind::HirBody | DepKind::CrateMetadata => { - if dep_node.extract_def_id(tcx).is_none() { + if dep_dep_node.extract_def_id(tcx).is_none() { // If the node does not exist anymore, we // just fail to mark green. return None diff --git a/src/test/incremental/change_name_of_static_in_fn.rs b/src/test/incremental/change_name_of_static_in_fn.rs new file mode 100644 index 0000000000000..5b27b6808ead2 --- /dev/null +++ b/src/test/incremental/change_name_of_static_in_fn.rs @@ -0,0 +1,17 @@ + +// revisions:rpass1 rpass2 rpass3 + +// See issue #57692. + +#![allow(warnings)] + +fn main() { + #[cfg(rpass1)] + { + static map: u64 = 0; + } + #[cfg(not(rpass1))] + { + static MAP: u64 = 0; + } +}