Skip to content

Commit

Permalink
Auto merge of #109335 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
[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`
  • Loading branch information
bors committed Mar 20, 2023
2 parents 2c8cc34 + 51bdb0f commit 8460ca8
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions 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)
==========================

Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Expand Up @@ -1237,15 +1237,17 @@ 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"
|| stem.ends_with("-gcc")
|| 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") {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/deref_into_dyn_supertrait.rs
Expand Up @@ -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,
});
}
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_lint/src/lints.rs
Expand Up @@ -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};

Expand Down Expand Up @@ -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>,
}
Expand Down
6 changes: 6 additions & 0 deletions compiler/rustc_middle/src/ty/sty.rs
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/lib.rs
Expand Up @@ -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 {
Expand Down
Expand Up @@ -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>.
Expand Down
1 change: 0 additions & 1 deletion src/ci/github-actions/ci.yml
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/version
@@ -1 +1 @@
1.68.0
1.68.1
15 changes: 15 additions & 0 deletions 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() {}

0 comments on commit 8460ca8

Please sign in to comment.