diff --git a/.gitignore b/.gitignore index d052f7a..574a930 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rustc-1.31.0-src.tar.xz +SOURCES/rustc-1.35.0-src.tar.xz diff --git a/.rust.metadata b/.rust.metadata index 7763ad5..9748f36 100644 --- a/.rust.metadata +++ b/.rust.metadata @@ -1 +1 @@ -79878ca48506ee7d17cd8375fca5f9950699c097 SOURCES/rustc-1.31.0-src.tar.xz +50cece3a9a40909c1042344e380e50681365e808 SOURCES/rustc-1.35.0-src.tar.xz diff --git a/SOURCES/0001-Deal-with-EINTR-in-net-timeout-tests.patch b/SOURCES/0001-Deal-with-EINTR-in-net-timeout-tests.patch deleted file mode 100644 index 7e49746..0000000 --- a/SOURCES/0001-Deal-with-EINTR-in-net-timeout-tests.patch +++ /dev/null @@ -1,118 +0,0 @@ -From f107514aef0b25b0d959941df1e45b18a478151b Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 30 Nov 2018 15:33:40 -0800 -Subject: [PATCH] Deal with EINTR in net timeout tests - -We've seen sporadic QE failures in the timeout tests on this assertion: - - assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); - -So there's an error, but not either of the expected kinds. Adding a -format to show the kind revealed `ErrorKind::Interrupted` (`EINTR`). - -For the cases that were using `read`, we can just use `read_exact` to -keep trying after interruption. For those using `recv_from`, we have to -manually loop until we get a non-interrupted result. ---- - src/libstd/net/tcp.rs | 10 ++++++---- - src/libstd/net/udp.rs | 20 ++++++++++++++++---- - src/libstd/sys/unix/ext/net.rs | 10 ++++++---- - 3 files changed, 28 insertions(+), 12 deletions(-) - -diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs -index ad212a547579..be797803233a 100644 ---- a/src/libstd/net/tcp.rs -+++ b/src/libstd/net/tcp.rs -@@ -1548,8 +1548,9 @@ mod tests { - - let mut buf = [0; 10]; - let start = Instant::now(); -- let kind = stream.read(&mut buf).err().expect("expected error").kind(); -- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); -+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind(); -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); - assert!(start.elapsed() > Duration::from_millis(400)); - drop(listener); - } -@@ -1570,8 +1571,9 @@ mod tests { - assert_eq!(b"hello world", &buf[..]); - - let start = Instant::now(); -- let kind = stream.read(&mut buf).err().expect("expected error").kind(); -- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); -+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind(); -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); - assert!(start.elapsed() > Duration::from_millis(400)); - drop(listener); - } -diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs -index 0ebe3284b4f0..fc68abae05a0 100644 ---- a/src/libstd/net/udp.rs -+++ b/src/libstd/net/udp.rs -@@ -1030,8 +1030,14 @@ mod tests { - let mut buf = [0; 10]; - - let start = Instant::now(); -- let kind = stream.recv_from(&mut buf).err().expect("expected error").kind(); -- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); -+ loop { -+ let kind = stream.recv_from(&mut buf).err().expect("expected error").kind(); -+ if kind != ErrorKind::Interrupted { -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); -+ break; -+ } -+ } - assert!(start.elapsed() > Duration::from_millis(400)); - } - -@@ -1049,8 +1055,14 @@ mod tests { - assert_eq!(b"hello world", &buf[..]); - - let start = Instant::now(); -- let kind = stream.recv_from(&mut buf).err().expect("expected error").kind(); -- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); -+ loop { -+ let kind = stream.recv_from(&mut buf).err().expect("expected error").kind(); -+ if kind != ErrorKind::Interrupted { -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); -+ break; -+ } -+ } - assert!(start.elapsed() > Duration::from_millis(400)); - } - -diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs -index 55f43ccd7db4..737437c76b7c 100644 ---- a/src/libstd/sys/unix/ext/net.rs -+++ b/src/libstd/sys/unix/ext/net.rs -@@ -1654,8 +1654,9 @@ mod test { - or_panic!(stream.set_read_timeout(Some(Duration::from_millis(1000)))); - - let mut buf = [0; 10]; -- let kind = stream.read(&mut buf).err().expect("expected error").kind(); -- assert!(kind == io::ErrorKind::WouldBlock || kind == io::ErrorKind::TimedOut); -+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind(); -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); - } - - #[test] -@@ -1675,8 +1676,9 @@ mod test { - or_panic!(stream.read(&mut buf)); - assert_eq!(b"hello world", &buf[..]); - -- let kind = stream.read(&mut buf).err().expect("expected error").kind(); -- assert!(kind == io::ErrorKind::WouldBlock || kind == io::ErrorKind::TimedOut); -+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind(); -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); - } - - // Ensure the `set_read_timeout` and `set_write_timeout` calls return errors --- -2.19.1 - diff --git a/SOURCES/0001-Fix-invalid_const_promotion-test-on-some-archs.patch b/SOURCES/0001-Fix-invalid_const_promotion-test-on-some-archs.patch deleted file mode 100644 index 17d0312..0000000 --- a/SOURCES/0001-Fix-invalid_const_promotion-test-on-some-archs.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 01e0d23d66d44f7a46b27a91b90b0d1c8aedc25f Mon Sep 17 00:00:00 2001 -From: James Duley -Date: Wed, 31 Oct 2018 22:59:53 +0000 -Subject: [PATCH] Fix invalid_const_promotion test on some archs - -On at least AArch64 `llvm.trap` raises SIGTRAP. ---- - src/test/run-pass/invalid_const_promotion.rs | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/test/run-pass/invalid_const_promotion.rs b/src/test/run-pass/invalid_const_promotion.rs -index ed8c4992417a..0f354e1aad6c 100644 ---- a/src/test/run-pass/invalid_const_promotion.rs -+++ b/src/test/run-pass/invalid_const_promotion.rs -@@ -39,6 +39,7 @@ fn check_status(status: std::process::ExitStatus) - use std::os::unix::process::ExitStatusExt; - - assert!(status.signal() == Some(libc::SIGILL) -+ || status.signal() == Some(libc::SIGTRAP) - || status.signal() == Some(libc::SIGABRT)); - } - --- -2.19.2 - diff --git a/SOURCES/0001-Limit-internalization-in-LLVM-8-ThinLTO.patch b/SOURCES/0001-Limit-internalization-in-LLVM-8-ThinLTO.patch new file mode 100644 index 0000000..3c09947 --- /dev/null +++ b/SOURCES/0001-Limit-internalization-in-LLVM-8-ThinLTO.patch @@ -0,0 +1,29 @@ +From b4131e297e18fde119f6f461b3e622218166b009 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 26 Apr 2019 08:58:14 -0700 +Subject: [PATCH] Limit internalization in LLVM 8 ThinLTO + +--- + src/rustllvm/PassWrapper.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp +index 319c66a21f17..0ebef82d3768 100644 +--- a/src/rustllvm/PassWrapper.cpp ++++ b/src/rustllvm/PassWrapper.cpp +@@ -873,8 +873,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, + return PrevailingType::Unknown; + }; + #if LLVM_VERSION_GE(8, 0) ++ // We don't have a complete picture in our use of ThinLTO, just our immediate ++ // crate, so we need `ImportEnabled = false` to limit internalization. ++ // Otherwise, we sometimes lose `static` values -- see #60184. + computeDeadSymbolsWithConstProp(Ret->Index, Ret->GUIDPreservedSymbols, +- deadIsPrevailing, /* ImportEnabled = */ true); ++ deadIsPrevailing, /* ImportEnabled = */ false); + #else + computeDeadSymbols(Ret->Index, Ret->GUIDPreservedSymbols, deadIsPrevailing); + #endif +-- +2.20.1 + diff --git a/SOURCES/0001-Revert-Do-not-add-src-to-sysroot-crates-paths-they-a.patch b/SOURCES/0001-Revert-Do-not-add-src-to-sysroot-crates-paths-they-a.patch deleted file mode 100644 index 1a7e792..0000000 --- a/SOURCES/0001-Revert-Do-not-add-src-to-sysroot-crates-paths-they-a.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 23359b93e6accbe5f45e2fe2089db31955e4008e Mon Sep 17 00:00:00 2001 -From: Igor Matuszewski -Date: Mon, 10 Dec 2018 13:52:41 +0100 -Subject: [PATCH] Revert "Do not add src/ to sysroot crates' paths, they - already have it now." - -This reverts commit d5d2f98d6f7668e2b6139c6cd93a8d20e28c396b. ---- - src/loader.rs | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/loader.rs b/src/loader.rs -index 645c95139164..2b931d9b7d95 100644 ---- a/src/loader.rs -+++ b/src/loader.rs -@@ -99,7 +99,8 @@ impl AnalysisLoader for CargoAnalysisLoader { - .join("lib") - .join("rustlib") - .join("src") -- .join("rust"); -+ .join("rust") -+ .join("src"); - - vec![ - SearchDirectory::new(libs_path, Some(src_path)), --- -2.19.2 - diff --git a/SOURCES/0001-Try-to-get-the-target-triple-from-rustc-itself.patch b/SOURCES/0001-Try-to-get-the-target-triple-from-rustc-itself.patch deleted file mode 100644 index 90f3115..0000000 --- a/SOURCES/0001-Try-to-get-the-target-triple-from-rustc-itself.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 72cd8aedc2901d6a6b598eadc001cc39040ae487 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 12 Dec 2018 16:51:31 -0800 -Subject: [PATCH] Try to get the target triple from rustc itself - -The prior method was trying to pick the triple out of the sysroot path. -A FIXME comment already notes that this doesn't work with custom -toolchains in rustup. It also fails with distro-installed toolchains, -where the sysroot may simply be `/usr`. - -The output of `rustc -Vv` is a more reliable source, as it contains a -line like `host: x86_64-unknown-linux-gnu`. This should be enough to -identify the triple for any `rustc`, but just in case, the path-based -code is kept as a fallback. ---- - src/loader.rs | 41 ++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 38 insertions(+), 3 deletions(-) - -diff --git a/src/loader.rs b/src/loader.rs -index 645c95139164..fe92bef1c596 100644 ---- a/src/loader.rs -+++ b/src/loader.rs -@@ -108,9 +108,33 @@ impl AnalysisLoader for CargoAnalysisLoader { - } - } - -+fn extract_target_triple(sys_root_path: &Path) -> String { -+ // First try to get the triple from the rustc version output, -+ // otherwise fall back on the rustup-style toolchain path. -+ extract_rustc_host_triple() -+ .unwrap_or_else(|| extract_rustup_target_triple(sys_root_path)) -+} -+ -+fn extract_rustc_host_triple() -> Option { -+ let rustc = env::var("RUSTC").unwrap_or(String::from("rustc")); -+ let verbose_version = Command::new(rustc) -+ .arg("--verbose") -+ .arg("--version") -+ .output() -+ .ok() -+ .and_then(|out| String::from_utf8(out.stdout).ok())?; -+ -+ // Extracts the triple from a line like `host: x86_64-unknown-linux-gnu` -+ verbose_version -+ .lines() -+ .find(|line| line.starts_with("host: ")) -+ .and_then(|host| host.split_whitespace().nth(1)) -+ .map(String::from) -+} -+ - // FIXME: This can fail when using a custom toolchain in rustup (often linked to - // `/$rust_repo/build/$target/stage2`) --fn extract_target_triple(sys_root_path: &Path) -> String { -+fn extract_rustup_target_triple(sys_root_path: &Path) -> String { - // Extracts nightly-x86_64-pc-windows-msvc from - // $HOME/.rustup/toolchains/nightly-x86_64-pc-windows-msvc - let toolchain = sys_root_path -@@ -169,7 +193,7 @@ mod tests { - r#"C:\Users\user\.rustup\toolchains\nightly-x86_64-pc-windows-msvc"#, - ); - assert_eq!( -- extract_target_triple(path), -+ extract_rustup_target_triple(path), - String::from("x86_64-pc-windows-msvc") - ); - } -@@ -180,8 +204,19 @@ mod tests { - "/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu", - ); - assert_eq!( -- extract_target_triple(path), -+ extract_rustup_target_triple(path), - String::from("x86_64-unknown-linux-gnu") - ); - } -+ -+ #[test] -+ fn target_triple() { -+ let sys_root_path = sys_root_path(); -+ let target_triple = extract_target_triple(&sys_root_path); -+ let target_path = sys_root_path -+ .join("lib") -+ .join("rustlib") -+ .join(&target_triple); -+ assert!(target_path.is_dir(), "{:?} is not a directory!", target_path); -+ } - } --- -2.19.2 - diff --git a/SOURCES/0001-bump-bootstrap-fix-compiletest-wrt.-exclude_should_p.patch b/SOURCES/0001-bump-bootstrap-fix-compiletest-wrt.-exclude_should_p.patch new file mode 100644 index 0000000..7ab3801 --- /dev/null +++ b/SOURCES/0001-bump-bootstrap-fix-compiletest-wrt.-exclude_should_p.patch @@ -0,0 +1,24 @@ +From 26e9a81c487f63c734bb7ac1739cdae2da2cb9b1 Mon Sep 17 00:00:00 2001 +From: Mazdak Farrokhzad +Date: Mon, 15 Apr 2019 04:05:37 +0200 +Subject: [PATCH] bump bootstrap; fix compiletest wrt. exclude_should_panic + +--- + src/tools/compiletest/src/main.rs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs +index 9e3c49119dea..431fd7969be0 100644 +--- a/src/tools/compiletest/src/main.rs ++++ b/src/tools/compiletest/src/main.rs +@@ -523,6 +523,7 @@ pub fn run_tests(config: &Config) { + + pub fn test_opts(config: &Config) -> test::TestOpts { + test::TestOpts { ++ exclude_should_panic: false, + filter: config.filter.clone(), + filter_exact: config.filter_exact, + run_ignored: if config.run_ignored { +-- +2.21.0 + diff --git a/SOURCES/rust-pr57840-llvm7-debuginfo-variants.patch b/SOURCES/rust-pr57840-llvm7-debuginfo-variants.patch new file mode 100644 index 0000000..71996bc --- /dev/null +++ b/SOURCES/rust-pr57840-llvm7-debuginfo-variants.patch @@ -0,0 +1,32 @@ +commit ab998a2eeb2bcdc69ce70c814af97f0d1302a404 (from d17f62d857c70508efbf60be41135880bcd2e062) +Merge: d17f62d857c7 9452a8dfa3ba +Author: Mazdak Farrokhzad +Date: Thu Jan 24 00:20:00 2019 +0100 + + Rollup merge of #57840 - tromey:fix-issue-57762, r=nikic + + Fix issue 57762 + + against 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 + +diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs +index 6deedd0b5ea3..9f63038c3623 100644 +--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs ++++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs +@@ -1164,7 +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 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 diff --git a/SOURCES/rust-pr61085-fix-ICE-with-incorrect-turbofish.patch b/SOURCES/rust-pr61085-fix-ICE-with-incorrect-turbofish.patch new file mode 100644 index 0000000..9929aaa --- /dev/null +++ b/SOURCES/rust-pr61085-fix-ICE-with-incorrect-turbofish.patch @@ -0,0 +1,229 @@ +From 476732995c2f5dc08e20eb8f9f03c628a48f5f41 Mon Sep 17 00:00:00 2001 +From: Oliver Scherer +Date: Thu, 23 May 2019 17:05:48 +0200 +Subject: [PATCH 1/3] WIP + +--- + src/librustc_typeck/check/mod.rs | 22 +++++++++++----------- + src/test/run-pass/issue-60989.rs | 4 ++++ + 2 files changed, 15 insertions(+), 11 deletions(-) + create mode 100644 src/test/run-pass/issue-60989.rs + +diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs +index 313ed19b945d..088729f12b1e 100644 +--- a/src/librustc_typeck/check/mod.rs ++++ b/src/librustc_typeck/check/mod.rs +@@ -5396,17 +5396,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { + + let tcx = self.tcx; + +- match def { +- Def::Local(nid) | Def::Upvar(nid, ..) => { +- let hid = self.tcx.hir().node_to_hir_id(nid); +- let ty = self.local_ty(span, hid).decl_ty; +- let ty = self.normalize_associated_types_in(span, &ty); +- self.write_ty(hir_id, ty); +- return (ty, def); +- } +- _ => {} +- } +- + let (def, def_id, ty) = self.rewrite_self_ctor(def, span); + let path_segs = AstConv::def_ids_for_path_segments(self, segments, self_ty, def); + +@@ -5469,6 +5458,17 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { + user_self_ty = None; + } + ++ match def { ++ Def::Local(nid) | Def::Upvar(nid, ..) => { ++ let hid = self.tcx.hir().node_to_hir_id(nid); ++ let ty = self.local_ty(span, hid).decl_ty; ++ let ty = self.normalize_associated_types_in(span, &ty); ++ self.write_ty(hir_id, ty); ++ return (ty, def); ++ } ++ _ => {} ++ } ++ + // Now we have to compare the types that the user *actually* + // provided against the types that were *expected*. If the user + // did not provide any types, then we want to substitute inference +diff --git a/src/test/run-pass/issue-60989.rs b/src/test/run-pass/issue-60989.rs +new file mode 100644 +index 000000000000..efaa74da3baa +--- /dev/null ++++ b/src/test/run-pass/issue-60989.rs +@@ -0,0 +1,4 @@ ++fn main() { ++ let c1 = (); ++ c1::<()>; ++} +-- +2.21.0 + + +From 97f204e6ae43bfe0fed64221d709a194bef728a4 Mon Sep 17 00:00:00 2001 +From: Oliver Scherer +Date: Thu, 23 May 2019 17:21:32 +0200 +Subject: [PATCH 2/3] Make regression test a compile-fail test + +--- + src/test/{run-pass => compile-fail}/issue-60989.rs | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) + rename src/test/{run-pass => compile-fail}/issue-60989.rs (100%) + +diff --git a/src/test/run-pass/issue-60989.rs b/src/test/compile-fail/issue-60989.rs +similarity index 100% +rename from src/test/run-pass/issue-60989.rs +rename to src/test/compile-fail/issue-60989.rs +-- +2.21.0 + + +From 6e81f8205a6d47648d086d26e96bf05e962e3715 Mon Sep 17 00:00:00 2001 +From: Eduard-Mihai Burtescu +Date: Thu, 23 May 2019 19:23:00 +0300 +Subject: [PATCH 3/3] rustc_typeck: don't produce a `DefId` or `Ty` from + `rewrite_self_ctor`, only a `Def`. + +--- + src/librustc_typeck/check/mod.rs | 30 ++++++++++++++++++---------- + src/test/compile-fail/issue-60989.rs | 4 ---- + src/test/ui/issue-60989.rs | 18 +++++++++++++++++ + src/test/ui/issue-60989.stderr | 15 ++++++++++++++ + 4 files changed, 52 insertions(+), 15 deletions(-) + delete mode 100644 src/test/compile-fail/issue-60989.rs + create mode 100644 src/test/ui/issue-60989.rs + create mode 100644 src/test/ui/issue-60989.stderr + +diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs +index 088729f12b1e..b6adcdbf35e9 100644 +--- a/src/librustc_typeck/check/mod.rs ++++ b/src/librustc_typeck/check/mod.rs +@@ -5330,7 +5330,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { + } + + // Rewrite `SelfCtor` to `Ctor` +- pub fn rewrite_self_ctor(&self, def: Def, span: Span) -> (Def, DefId, Ty<'tcx>) { ++ pub fn rewrite_self_ctor(&self, def: Def, span: Span) -> Def { + let tcx = self.tcx; + if let Def::SelfCtor(impl_def_id) = def { + let ty = self.impl_self_ty(span, impl_def_id).ty; +@@ -5340,8 +5340,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { + Some(adt_def) if adt_def.has_ctor() => { + let variant = adt_def.non_enum_variant(); + let ctor_def_id = variant.ctor_def_id.unwrap(); +- let def = Def::Ctor(ctor_def_id, CtorOf::Struct, variant.ctor_kind); +- (def, ctor_def_id, tcx.type_of(ctor_def_id)) ++ Def::Ctor(ctor_def_id, CtorOf::Struct, variant.ctor_kind) + } + _ => { + let mut err = tcx.sess.struct_span_err(span, +@@ -5364,16 +5363,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { + } + err.emit(); + +- (def, impl_def_id, tcx.types.err) ++ def + } + } + } else { +- let def_id = def.def_id(); +- +- // The things we are substituting into the type should not contain +- // escaping late-bound regions, and nor should the base type scheme. +- let ty = tcx.type_of(def_id); +- (def, def_id, ty) ++ def + } + } + +@@ -5396,7 +5390,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { + + let tcx = self.tcx; + +- let (def, def_id, ty) = self.rewrite_self_ctor(def, span); ++ let def = self.rewrite_self_ctor(def, span); + let path_segs = AstConv::def_ids_for_path_segments(self, segments, self_ty, def); + + let mut user_self_ty = None; +@@ -5501,6 +5495,20 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { + tcx.generics_of(*def_id).has_self + }).unwrap_or(false); + ++ let (def_id, ty) = if let Def::SelfCtor(impl_def_id) = def { ++ // NOTE(eddyb) an error has already been emitted by `rewrite_self_ctor`, ++ // avoid using the wrong type here. This isn't in `rewrite_self_ctor` ++ // itself because that runs too early (see #60989). ++ (impl_def_id, tcx.types.err) ++ } else { ++ let def_id = def.def_id(); ++ ++ // The things we are substituting into the type should not contain ++ // escaping late-bound regions, and nor should the base type scheme. ++ let ty = tcx.type_of(def_id); ++ (def_id, ty) ++ }; ++ + let substs = AstConv::create_substs_for_generic_args( + tcx, + def_id, +diff --git a/src/test/compile-fail/issue-60989.rs b/src/test/compile-fail/issue-60989.rs +deleted file mode 100644 +index efaa74da3baa..000000000000 +--- a/src/test/compile-fail/issue-60989.rs ++++ /dev/null +@@ -1,4 +0,0 @@ +-fn main() { +- let c1 = (); +- c1::<()>; +-} +diff --git a/src/test/ui/issue-60989.rs b/src/test/ui/issue-60989.rs +new file mode 100644 +index 000000000000..930e98bedce8 +--- /dev/null ++++ b/src/test/ui/issue-60989.rs +@@ -0,0 +1,18 @@ ++struct A {} ++struct B {} ++ ++impl From for B { ++ fn from(a: A) -> B { ++ B{} ++ } ++} ++ ++fn main() { ++ let c1 = (); ++ c1::<()>; ++ //~^ ERROR type arguments are not allowed for this type ++ ++ let c1 = A {}; ++ c1::>; ++ //~^ ERROR type arguments are not allowed for this type ++} +diff --git a/src/test/ui/issue-60989.stderr b/src/test/ui/issue-60989.stderr +new file mode 100644 +index 000000000000..55a0b9626df7 +--- /dev/null ++++ b/src/test/ui/issue-60989.stderr +@@ -0,0 +1,15 @@ ++error[E0109]: type arguments are not allowed for this type ++ --> $DIR/issue-60989.rs:12:10 ++ | ++LL | c1::<()>; ++ | ^^ type argument not allowed ++ ++error[E0109]: type arguments are not allowed for this type ++ --> $DIR/issue-60989.rs:16:10 ++ | ++LL | c1::>; ++ | ^^^^^^^ type argument not allowed ++ ++error: aborting due to 2 previous errors ++ ++For more information about this error, try `rustc --explain E0109`. +-- +2.21.0 + diff --git a/SPECS/rust.spec b/SPECS/rust.spec index a33d385..badcce1 100644 --- a/SPECS/rust.spec +++ b/SPECS/rust.spec @@ -10,10 +10,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.30.0 -%global bootstrap_cargo 1.30.0 -%global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2018-10-25 +%global bootstrap_rust 1.34.0 +%global bootstrap_cargo 1.34.0 +%global bootstrap_channel 1.34.2 +%global bootstrap_date 2019-05-14 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -53,18 +53,9 @@ %bcond_with lldb %endif -# Some sub-packages are versioned independently of the rust compiler and runtime itself. -# Also beware that if any of these are not changed in a version bump, then the release -# number should still increase, not be reset to 1! -%global rustc_version 1.31.0 -%global cargo_version 1.31.0 -%global rustfmt_version 1.0.0 -%global rls_version 1.31.6 -%global clippy_version 0.0.212 - Name: rust -Version: %{rustc_version} -Release: 5%{?dist} +Version: 1.35.0 +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -72,25 +63,24 @@ URL: https://www.rust-lang.org ExclusiveArch: %{rust_arches} %if "%{channel}" == "stable" -%global rustc_package rustc-%{rustc_version}-src +%global rustc_package rustc-%{version}-src %else %global rustc_package rustc-%{channel}-src %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/rust/pull/56394 -Patch1: 0001-Deal-with-EINTR-in-net-timeout-tests.patch +# Revert https://github.com/rust-lang/rust/pull/57840 +# We do have the necessary fix in our LLVM 7. +Patch1: rust-pr57840-llvm7-debuginfo-variants.patch -# https://github.com/rust-lang/rust/pull/55575 -Patch2: 0001-Fix-invalid_const_promotion-test-on-some-archs.patch +# https://github.com/rust-lang/rust/pull/60313 +Patch2: 0001-Limit-internalization-in-LLVM-8-ThinLTO.patch -# https://github.com/rust-lang/rls/issues/1171#issuecomment-445813148 -# https://github.com/rust-dev-tools/rls-analysis/commit/23359b93e6accbe5f45e2fe2089db31955e4008e -# Only revert for Rust 1.31 -- the change was meant to go with 1.32 and later. -Patch3: 0001-Revert-Do-not-add-src-to-sysroot-crates-paths-they-a.patch +# https://github.com/rust-lang/rust/pull/61085 +Patch3: rust-pr61085-fix-ICE-with-incorrect-turbofish.patch -# https://github.com/rust-dev-tools/rls-analysis/pull/160 -Patch4: 0001-Try-to-get-the-target-triple-from-rustc-itself.patch +# https://github.com/rust-lang/rust/pull/59974/commits/26e9a81c487f63c734bb7ac1739cdae2da2cb9b1 +Patch4: 0001-bump-bootstrap-fix-compiletest-wrt.-exclude_should_p.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -136,10 +126,10 @@ Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} %else BuildRequires: cargo >= %{bootstrap_cargo} %if 0%{?fedora} >= 27 || 0%{?rhel} > 7 -BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{rustc_version}) +BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) %else BuildRequires: %{name} >= %{bootstrap_rust} -BuildConflicts: %{name} > %{rustc_version} +BuildConflicts: %{name} > %{version} %endif %global local_rust_root %{_prefix} %endif @@ -180,7 +170,7 @@ Provides: bundled(llvm) = 8.0.0~svn %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} -%global llvm llvm5.0 +%global llvm llvm7.0 %endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} @@ -188,7 +178,7 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 5.0 +BuildRequires: %{llvm}-devel >= 6.0 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel @@ -203,14 +193,14 @@ BuildRequires: gdb # TODO: work on unbundling these! Provides: bundled(libbacktrace) = 8.1.0 -Provides: bundled(miniz) = 1.16~beta+r1 +Provides: bundled(miniz) = 2.0.7 # Virtual provides for folks who attempt "dnf install rustc" -Provides: rustc = %{rustc_version}-%{release} -Provides: rustc%{?_isa} = %{rustc_version}-%{release} +Provides: rustc = %{version}-%{release} +Provides: rustc%{?_isa} = %{version}-%{release} # Always require our exact standard library -Requires: %{name}-std-static%{?_isa} = %{rustc_version}-%{release} +Requires: %{name}-std-static%{?_isa} = %{version}-%{release} # The C compiler is needed at runtime just for linking. Someday rustc might # invoke the linker directly, and then we'll only need binutils. @@ -240,13 +230,9 @@ Requires: /usr/bin/cc %global rustflags -Clink-arg=-Wl,-z,relro,-z,now %if %{without bundled_llvm} -%if 0%{?fedora} || 0%{?rhel} > 7 || 0%{?scl:1} +%if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1} %global llvm_has_filecheck 1 %endif -%if "%{llvm_root}" != "%{_prefix}" -# https://github.com/rust-lang/rust/issues/40717 -%global library_path $(%{llvm_root}/bin/llvm-config --libdir) -%endif %endif %description @@ -276,7 +262,7 @@ This package includes the common functionality for %{name}-gdb and %{name}-lldb. Summary: GDB pretty printers for Rust BuildArch: noarch Requires: gdb -Requires: %{name}-debugger-common = %{rustc_version}-%{release} +Requires: %{name}-debugger-common = %{version}-%{release} %description gdb This package includes the rust-gdb script, which allows easier debugging of Rust @@ -293,7 +279,7 @@ Summary: LLDB pretty printers for Rust Requires: lldb Requires: python3-lldb -Requires: %{name}-debugger-common = %{rustc_version}-%{release} +Requires: %{name}-debugger-common = %{version}-%{release} %description lldb This package includes the rust-lldb script, which allows easier debugging of Rust @@ -316,7 +302,6 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool -Version: %{cargo_version} %if %with bundled_libgit2 Provides: bundled(libgit2) = 0.27 %endif @@ -335,11 +320,10 @@ and ensure that you'll always get a repeatable build. %package -n cargo-doc Summary: Documentation for Cargo -Version: %{cargo_version} BuildArch: noarch # Cargo no longer builds its own documentation # https://github.com/rust-lang/cargo/pull/4904 -Requires: rust-doc = %{rustc_version}-%{release} +Requires: rust-doc = %{version}-%{release} %description -n cargo-doc This package includes HTML documentation for Cargo. @@ -347,12 +331,11 @@ This package includes HTML documentation for Cargo. %package -n rustfmt Summary: Tool to find and fix Rust formatting issues -Version: %{rustfmt_version} Requires: cargo # The component/package was rustfmt-preview until Rust 1.31. Obsoletes: rustfmt-preview < 1.0.0 -Provides: rustfmt-preview = %{rustfmt_version}-%{release} +Provides: rustfmt-preview = %{version}-%{release} %description -n rustfmt A tool for formatting Rust code according to style guidelines. @@ -360,8 +343,6 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration -Version: %{rls_version} -Provides: rls = %{rls_version} %if %with bundled_libgit2 Provides: bundled(libgit2) = 0.27 %endif @@ -370,11 +351,11 @@ Provides: bundled(libssh2) = 1.8.1~dev %endif Requires: rust-analysis # /usr/bin/rls is dynamically linked against internal rustc libs -Requires: %{name}%{?_isa} = %{rustc_version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} # The component/package was rls-preview until Rust 1.31. Obsoletes: rls-preview < 1.31.6 -Provides: rls-preview = %{rls_version}-%{release} +Provides: rls-preview = %{version}-%{release} %description -n rls The Rust Language Server provides a server that runs in the background, @@ -385,15 +366,13 @@ reformatting, and code completion, and enables renaming and refactorings. %package -n clippy Summary: Lints to catch common mistakes and improve your Rust code -Version: %{clippy_version} -Provides: clippy = %{clippy_version} Requires: cargo # /usr/bin/clippy-driver is dynamically linked against internal rustc libs -Requires: %{name}%{?_isa} = %{rustc_version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} # The component/package was clippy-preview until Rust 1.31. Obsoletes: clippy-preview <= 0.0.212 -Provides: clippy-preview = %{clippy_version}-%{release} +Provides: clippy-preview = %{version}-%{release} %description -n clippy A collection of lints to catch common mistakes and improve your Rust code. @@ -410,7 +389,7 @@ useful as a reference for code completion tools in various editors. %package analysis Summary: Compiler analysis data for the Rust standard library -Requires: rust-std-static%{?_isa} = %{rustc_version}-%{release} +Requires: rust-std-static%{?_isa} = %{version}-%{release} %description analysis This package contains analysis data files produced with rustc's -Zsave-analysis @@ -430,36 +409,24 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 +%patch1 -p1 -R %patch2 -p1 - -pushd src/vendor/rls-analysis %patch3 -p1 %patch4 -p1 -popd %if "%{python}" != "python2" sed -i.try-py3 -e '/try python2.7/i try %{python} "$@"' ./configure %endif -# We're disabling jemalloc, but rust-src still wants it. -# rm -rf src/jemalloc/ - %if %without bundled_llvm -rm -rf src/llvm/ +rm -rf src/llvm-project/ %endif # We never enable emscripten. rm -rf src/llvm-emscripten/ -# We never enable other LLVM tools. -rm -rf src/tools/clang -rm -rf src/tools/lld -rm -rf src/tools/lldb - -# extract bundled licenses for packaging -sed -e '/*\//q' src/libbacktrace/backtrace.h \ - >src/libbacktrace/LICENSE-libbacktrace +# rename bundled license for packaging +cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace} %if %{with bundled_llvm} && 0%{?epel} mkdir -p cmake-bin @@ -477,7 +444,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ # The configure macro will modify some autoconf-related files, which upsets # cargo when it tries to verify checksums in those files. If we just truncate # that file list, cargo won't have anything to complain about. -find src/vendor -name .cargo-checksum.json \ +find vendor -name .cargo-checksum.json \ -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' @@ -494,7 +461,6 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %endif %{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} # We're going to override --libdir when configuring to get rustlib into a @@ -502,7 +468,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %global common_libdir %{_prefix}/lib %global rustlibdir %{common_libdir}/rustlib -%ifarch %{arm} %{ix86} +%ifarch %{arm} %{ix86} s390x # full debuginfo is exhausting memory; just do libstd for now # https://github.com/rust-lang/rust/issues/45854 %if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7) @@ -516,6 +482,13 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %define enable_debuginfo --enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines %endif +# We want the best optimization for std, but it caused problems for rpm-ostree +# on ppc64le to have all of the compiler_builtins in a single object: +# https://bugzilla.redhat.com/show_bug.cgi?id=1713090 +%ifnarch %{power64} +%define codegen_units_std --set rust.codegen-units-std=1 +%endif + %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ @@ -523,12 +496,12 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ %{!?llvm_has_filecheck: --disable-codegen-tests} \ %{!?with_llvm_static: --enable-llvm-link-shared } } \ - --disable-jemalloc \ --disable-rpath \ %{enable_debuginfo} \ --enable-extended \ --enable-vendor \ --enable-verbose-tests \ + %{?codegen_units_std} \ --release-channel=%{channel} %{python} ./x.py build @@ -537,7 +510,6 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %install %{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} DESTDIR=%{buildroot} %{python} ./x.py install @@ -606,7 +578,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %check %{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} # The results are not stable on koji, so mask errors and just log it. @@ -622,7 +593,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files %license COPYRIGHT LICENSE-APACHE LICENSE-MIT -%license src/libbacktrace/LICENSE-libbacktrace +%license vendor/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace %doc README.md %{_bindir}/rustc %{_bindir}/rustdoc @@ -634,6 +605,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.so %{rustlibdir}/%{rust_triple}/codegen-backends/ +%exclude %{_bindir}/*miri %files std-static @@ -652,6 +624,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files gdb %{_bindir}/rust-gdb %{rustlibdir}/etc/gdb_*.py* +%exclude %{_bindir}/rust-gdbgui %if %with lldb @@ -668,7 +641,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %{_docdir}/%{name}/html/*/ %{_docdir}/%{name}/html/*.html %{_docdir}/%{name}/html/*.css +%{_docdir}/%{name}/html/*.ico %{_docdir}/%{name}/html/*.js +%{_docdir}/%{name}/html/*.png %{_docdir}/%{name}/html/*.svg %{_docdir}/%{name}/html/*.woff %license %{_docdir}/%{name}/html/*.txt @@ -721,6 +696,27 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Wed May 29 2019 Josh Stone - 1.35.0-2 +- Fix compiletest for rebuild testing. + +* Thu May 23 2019 Josh Stone - 1.35.0-1 +- Update to 1.35.0. + +* Tue May 14 2019 Josh Stone - 1.34.2-1 +- Update to 1.34.2 -- fixes CVE-2019-12083. + +* Thu May 09 2019 Josh Stone - 1.34.1-1 +- Update to 1.34.1. + +* Thu Apr 11 2019 Josh Stone - 1.34.0-1 +- Update to 1.34.0. + +* Wed Apr 10 2019 Josh Stone - 1.33.0-1 +- Update to 1.33.0. + +* Tue Apr 09 2019 Josh Stone - 1.32.0-1 +- Update to 1.32.0. + * Fri Dec 14 2018 Josh Stone - 1.31.0-5 - Restore rust-lldb.