Merge branch 'rosa2016.1' into rosa2019.0

This commit is contained in:
Алзим 2019-07-06 02:19:54 +03:00
commit df3e0ce928
5 changed files with 11 additions and 300 deletions

View file

@ -1,4 +1,4 @@
sources:
rust-1.34.0-i686-unknown-linux-gnu.tar.xz: b3558abaefc8c321a0960ae7564f17e54bbd75f1
rust-1.34.0-x86_64-unknown-linux-gnu.tar.xz: add8a99ec2d9d855f7089e192d3dbe2b95f12c89
rustc-1.35.0-src.tar.xz: 50cece3a9a40909c1042344e380e50681365e808
rust-1.35.0-i686-unknown-linux-gnu.tar.xz: d0adfcfa3eabb7a9b4fd4b0060579639df5a80e7
rust-1.35.0-x86_64-unknown-linux-gnu.tar.xz: 9fa9e480b8c17a716b3da298a64b9e0e517898ad
rustc-1.36.0-src.tar.xz: 70c77706bd62fcf8a784b7b14108f560f2751887

View file

@ -1,29 +0,0 @@
From b4131e297e18fde119f6f461b3e622218166b009 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
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

View file

@ -1,24 +0,0 @@
From 26e9a81c487f63c734bb7ac1739cdae2da2cb9b1 Mon Sep 17 00:00:00 2001
From: Mazdak Farrokhzad <twingoow@gmail.com>
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

View file

@ -1,229 +0,0 @@
From 476732995c2f5dc08e20eb8f9f03c628a48f5f41 Mon Sep 17 00:00:00 2001
From: Oliver Scherer <github35764891676564198441@oli-obk.de>
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 <github35764891676564198441@oli-obk.de>
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 <edy.burt@gmail.com>
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<A> 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::<Into<B>>;
+ //~^ 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::<Into<B>>;
+ | ^^^^^^^ type argument not allowed
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0109`.
--
2.21.0

View file

@ -25,9 +25,9 @@
# 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.
%define bootstrap_rust 1.34.0
%define bootstrap_cargo 1.34.0
%define bootstrap_date 2019-05-14
%define bootstrap_rust 1.35.0
%define bootstrap_cargo 1.35.0
%define bootstrap_date 2019-05-23
%bcond_without bootstrap
@ -61,7 +61,7 @@
Summary: The Rust Programming Language
Name: rust
Version: 1.35.0
Version: 1.36.0
Release: 1
License: (ASL 2.0 or MIT) and (BSD and MIT)
Group: Development/Rust
@ -75,12 +75,6 @@ Source10: rust.rpmlintrc
# 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/60313
Patch2: 0001-Limit-internalization-in-LLVM-8-ThinLTO.patch
# https://github.com/rust-lang/rust/pull/61085
Patch3: rust-pr61085-fix-ICE-with-incorrect-turbofish.patch
# https://github.com/rust-lang/rust/pull/59974/commits/26e9a81c487f63c734bb7ac1739cdae2da2cb9b1
Patch4: 0001-bump-bootstrap-fix-compiletest-wrt.-exclude_should_p.patch
BuildRequires: ncurses-devel
BuildRequires: curl
BuildRequires: pkgconfig(libcurl)
@ -199,7 +193,11 @@ which allows easier debugging of Rust programs.
Summary: LLDB pretty printers for Rust
Group: Development/Rust
Requires: lldb
%if %{mdvver} > 201610
Requires: python3-lldb
%else
Requires: python-lldb
%endif
Requires: %{name}-debugger-common = %{version}-%{release}
BuildArch: noarch
@ -349,11 +347,6 @@ test -f '%{local_rust_root}/bin/rustc'
%setup -qn rustc-%{version}-src
%patch1 -p1 -R
%if %{mdkver} > 201610
%patch2 -p1
%endif
%patch3 -p1
%patch4 -p1
# python3
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure