summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-20 14:36:49 +0000
committerbors <bors@rust-lang.org>2023-03-20 14:36:49 +0000
commit8460ca823e8367a30dda430efda790588b8c84d3 (patch)
tree1e32b07304207ef4353c452da4bca3cbc7fba53d
parent2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74 (diff)
parent51bdb0f085d02aeab0adbf4b497afc22d6b26f3f (diff)
downloadrust-8460ca823e8367a30dda430efda790588b8c84d3.tar.gz
Auto merge of #109335 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum1.68.1
[stable] 1.68.1 release This packages up a set of release notes, version bump, and backports of: * Don't eagerly convert principal to string #108162 * Revert "enable ThinLTO for rustc on x86_64-pc-windows-msvc dist builds" #109094 * Create dirs for build_triple #109111 * Fix linker detection for clang with prefix #109156 * ci: use apt install --download-only for solaris debs #108951 The last of those is not yet stable-accepted but I expect it to be, we will drop it and rebuild artifacts if we don't actually approve it. r? `@Mark-Simulacrum`
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--RELEASES.md12
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs4
-rw-r--r--compiler/rustc_lint/src/deref_into_dyn_supertrait.rs2
-rw-r--r--compiler/rustc_lint/src/lints.rs5
-rw-r--r--compiler/rustc_middle/src/ty/sty.rs6
-rw-r--r--src/bootstrap/lib.rs1
-rwxr-xr-xsrc/ci/docker/host-x86_64/dist-various-2/build-solaris-toolchain.sh10
-rw-r--r--src/ci/github-actions/ci.yml1
-rw-r--r--src/version2
-rw-r--r--tests/ui/lint/issue-108155.rs15
11 files changed, 46 insertions, 14 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2071c46340c..349332f8cf5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -438,7 +438,7 @@ jobs:
os: windows-latest-xl
- name: dist-x86_64-msvc
env:
- RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --host=x86_64-pc-windows-msvc --target=x86_64-pc-windows-msvc --enable-full-tools --enable-profiler --set rust.lto=thin"
+ RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --host=x86_64-pc-windows-msvc --target=x86_64-pc-windows-msvc --enable-full-tools --enable-profiler"
SCRIPT: PGO_HOST=x86_64-pc-windows-msvc src/ci/pgo.sh python x.py dist bootstrap --include-default-paths
DIST_REQUIRE_ALL_TOOLS: 1
os: windows-latest-xl
diff --git a/RELEASES.md b/RELEASES.md
index f418ab23d10..bc776ce2ac8 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,3 +1,15 @@
+Version 1.68.1 (2023-03-23)
+===========================
+
+- [Fix miscompilation in produced Windows MSVC artifacts](https://github.com/rust-lang/rust/pull/109094)
+ This was introduced by enabling ThinLTO for the distributed rustc which led
+ to miscompilations in the resulting binary. Currently this is believed to be
+ limited to the -Zdylib-lto flag used for rustc compilation, rather than a
+ general bug in ThinLTO, so only rustc artifacts should be affected.
+- [Fix --enable-local-rust builds](https://github.com/rust-lang/rust/pull/109111/)
+- [Treat `$prefix-clang` as `clang` in linker detection code](https://github.com/rust-lang/rust/pull/109156)
+- [Fix panic in compiler code](https://github.com/rust-lang/rust/pull/108162)
+
Version 1.68.0 (2023-03-09)
==========================
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index b148e4185a6..34e042376c1 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -1237,7 +1237,7 @@ pub fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
.and_then(|(lhs, rhs)| rhs.chars().all(char::is_numeric).then_some(lhs))
.unwrap_or(stem);
- // GCC can have an optional target prefix.
+ // GCC/Clang can have an optional target prefix.
let flavor = if stem == "emcc" {
LinkerFlavor::EmCc
} else if stem == "gcc"
@@ -1245,7 +1245,9 @@ pub fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
|| stem == "g++"
|| stem.ends_with("-g++")
|| stem == "clang"
+ || stem.ends_with("-clang")
|| stem == "clang++"
+ || stem.ends_with("-clang++")
{
LinkerFlavor::from_cli(LinkerFlavorCli::Gcc, &sess.target)
} else if stem == "wasm-ld" || stem.ends_with("-wasm-ld") {
diff --git a/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs b/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs
index dff5a645c17..a45d8156c24 100644
--- a/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs
+++ b/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs
@@ -78,7 +78,7 @@ impl<'tcx> LateLintPass<'tcx> for DerefIntoDynSupertrait {
});
cx.emit_spanned_lint(DEREF_INTO_DYN_SUPERTRAIT, cx.tcx.def_span(item.owner_id.def_id), SupertraitAsDerefTarget {
t,
- target_principal: target_principal.to_string(),
+ target_principal,
label,
});
}
diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs
index c997d8945d1..329ece28ef8 100644
--- a/compiler/rustc_lint/src/lints.rs
+++ b/compiler/rustc_lint/src/lints.rs
@@ -8,7 +8,7 @@ use rustc_errors::{
};
use rustc_hir::def_id::DefId;
use rustc_macros::{LintDiagnostic, Subdiagnostic};
-use rustc_middle::ty::{Predicate, Ty, TyCtxt};
+use rustc_middle::ty::{PolyExistentialTraitRef, Predicate, Ty, TyCtxt};
use rustc_session::parse::ParseSess;
use rustc_span::{edition::Edition, sym, symbol::Ident, Span, Symbol};
@@ -556,8 +556,7 @@ pub struct BuiltinUnexpectedCliConfigValue {
#[diag(lint_supertrait_as_deref_target)]
pub struct SupertraitAsDerefTarget<'a> {
pub t: Ty<'a>,
- pub target_principal: String,
- // pub target_principal: Binder<'a, ExistentialTraitRef<'b>>,
+ pub target_principal: PolyExistentialTraitRef<'a>,
#[subdiagnostic]
pub label: Option<SupertraitAsDerefTargetLabel>,
}
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs
index 6a7b23e40a7..91a7d5d38a1 100644
--- a/compiler/rustc_middle/src/ty/sty.rs
+++ b/compiler/rustc_middle/src/ty/sty.rs
@@ -931,6 +931,12 @@ impl<'tcx> PolyExistentialTraitRef<'tcx> {
}
}
+impl rustc_errors::IntoDiagnosticArg for PolyExistentialTraitRef<'_> {
+ fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> {
+ self.to_string().into_diagnostic_arg()
+ }
+}
+
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)]
#[derive(HashStable)]
pub enum BoundVariableKind {
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index d44b96cfb99..0474ab344fe 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -593,6 +593,7 @@ impl Build {
// Make a symbolic link so we can use a consistent directory in the documentation.
let build_triple = build.out.join(&build.build.triple);
+ t!(fs::create_dir_all(&build_triple));
let host = build.out.join("host");
if let Err(e) = symlink_dir(&build.config, &build_triple, &host) {
if e.kind() != ErrorKind::AlreadyExists {
diff --git a/src/ci/docker/host-x86_64/dist-various-2/build-solaris-toolchain.sh b/src/ci/docker/host-x86_64/dist-various-2/build-solaris-toolchain.sh
index cf784a66ae4..3939b4b7c41 100755
--- a/src/ci/docker/host-x86_64/dist-various-2/build-solaris-toolchain.sh
+++ b/src/ci/docker/host-x86_64/dist-various-2/build-solaris-toolchain.sh
@@ -32,24 +32,22 @@ cd solaris
dpkg --add-architecture $APT_ARCH
apt-get update
-apt-get download $(apt-cache depends --recurse --no-replaces \
+apt-get install -y --download-only \
libc:$APT_ARCH \
- liblgrp-dev:$APT_ARCH \
liblgrp:$APT_ARCH \
libm-dev:$APT_ARCH \
libpthread:$APT_ARCH \
libresolv:$APT_ARCH \
librt:$APT_ARCH \
- libsendfile-dev:$APT_ARCH \
libsendfile:$APT_ARCH \
libsocket:$APT_ARCH \
system-crt:$APT_ARCH \
- system-header:$APT_ARCH \
- | grep "^\w")
+ system-header:$APT_ARCH
-for deb in *$APT_ARCH.deb; do
+for deb in /var/cache/apt/archives/*$APT_ARCH.deb; do
dpkg -x $deb .
done
+apt-get clean
# The -dev packages are not available from the apt repository we're using.
# However, those packages are just symlinks from *.so to *.so.<version>.
diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml
index df07d4fae71..743b57ed46e 100644
--- a/src/ci/github-actions/ci.yml
+++ b/src/ci/github-actions/ci.yml
@@ -675,7 +675,6 @@ jobs:
--target=x86_64-pc-windows-msvc
--enable-full-tools
--enable-profiler
- --set rust.lto=thin
SCRIPT: PGO_HOST=x86_64-pc-windows-msvc src/ci/pgo.sh python x.py dist bootstrap --include-default-paths
DIST_REQUIRE_ALL_TOOLS: 1
<<: *job-windows-xl
diff --git a/src/version b/src/version
index ee2f4ca9130..0944cc489c2 100644
--- a/src/version
+++ b/src/version
@@ -1 +1 @@
-1.68.0
+1.68.1
diff --git a/tests/ui/lint/issue-108155.rs b/tests/ui/lint/issue-108155.rs
new file mode 100644
index 00000000000..4ae0cbd92ff
--- /dev/null
+++ b/tests/ui/lint/issue-108155.rs
@@ -0,0 +1,15 @@
+// check-pass
+// check that `deref_into_dyn_supertrait` doesn't cause ICE by eagerly converting
+// a cancelled lint
+
+#![allow(deref_into_dyn_supertrait)]
+
+trait Trait {}
+impl std::ops::Deref for dyn Trait + Send + Sync {
+ type Target = dyn Trait;
+ fn deref(&self) -> &Self::Target {
+ self
+ }
+}
+
+fn main() {}