diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2071c46340cad..349332f8cf5a6 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 f418ab23d10af..bc776ce2ac8e6 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 b148e4185a68a..34e042376c122 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 dff5a645c175e..a45d8156c244c 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 c997d8945d16e..329ece28ef837 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, } diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 6a7b23e40a779..91a7d5d38a1ef 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 d44b96cfb991e..0474ab344fe2d 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 cf784a66ae4f9..3939b4b7c41c1 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.. diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index df07d4fae7117..743b57ed46e4f 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 ee2f4ca913048..0944cc489c25b 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 0000000000000..4ae0cbd92ff16 --- /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() {}