diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:37 +0000 |
commit | 246f239d9f40f633160f0c18f87a20922d4e77bb (patch) | |
tree | 5a88572663584b3d4d28e5a20e10abab1be40884 /debian/patches | |
parent | Releasing progress-linux version 1.64.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.tar.xz rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.zip |
Merging debian version 1.65.0+dfsg1-2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
19 files changed, 334 insertions, 906 deletions
diff --git a/debian/patches/d-0000-ignore-removed-submodules.patch b/debian/patches/d-0000-ignore-removed-submodules.patch index 3dfaf06cb..26d1e4361 100644 --- a/debian/patches/d-0000-ignore-removed-submodules.patch +++ b/debian/patches/d-0000-ignore-removed-submodules.patch @@ -3,21 +3,22 @@ Date: Sat, 2 Oct 2021 01:07:59 +0100 Subject: d-0000-ignore-removed-submodules --- - Cargo.toml | 36 ++++++++---------------------------- - src/bootstrap/bootstrap.py | 4 ---- - src/bootstrap/builder.rs | 7 +------ - src/bootstrap/doc.rs | 1 - - src/bootstrap/test.rs | 12 +----------- - src/tools/clippy/Cargo.toml | 5 ----- - src/tools/rustfmt/Cargo.toml | 5 ----- - src/tools/tidy/src/deps.rs | 2 +- - 8 files changed, 11 insertions(+), 61 deletions(-) + Cargo.toml | 15 --------------- + src/bootstrap/bootstrap.py | 4 ---- + src/bootstrap/builder.rs | 11 +---------- + src/bootstrap/doc.rs | 1 - + src/bootstrap/test.rs | 12 +----------- + src/tools/clippy/Cargo.toml | 5 ----- + src/tools/rust-analyzer/Cargo.toml | 11 ++++++++++- + src/tools/rustfmt/Cargo.toml | 5 ----- + src/tools/tidy/src/deps.rs | 2 +- + 9 files changed, 13 insertions(+), 53 deletions(-) diff --git a/Cargo.toml b/Cargo.toml -index ffc886d..7231b60 100644 +index e49fe5e..863c800 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -16,25 +16,14 @@ members = [ +@@ -16,27 +16,15 @@ members = [ "src/tools/tidy", "src/tools/tier-check", "src/tools/build-manifest", @@ -38,38 +39,16 @@ index ffc886d..7231b60 100644 "src/tools/unicode-table-generator", - "src/tools/expand-yaml-anchors", "src/tools/jsondocck", + "src/tools/jsondoclint", "src/tools/html-checker", - "src/tools/bump-stage0", +- "src/tools/replace-version-placeholder", "src/tools/lld-wrapper", ] -@@ -96,25 +85,16 @@ gimli.debug = 0 - miniz_oxide.debug = 0 +@@ -99,9 +87,6 @@ miniz_oxide.debug = 0 object.debug = 0 --# We want the RLS to use the version of Cargo that we've got vendored in this --# repository to ensure that the same exact version of Cargo is used by both the --# RLS and the Cargo binary itself. The RLS depends on Cargo as a git repository --# so we use a `[patch]` here to override the github repository with our local --# vendored copy. --[patch."https://github.com/rust-lang/cargo"] --cargo = { path = "src/tools/cargo" } --cargo-util = { path = "src/tools/cargo/crates/cargo-util" } -- --[patch."https://github.com/rust-lang/rustfmt"] --# Similar to Cargo above we want the RLS to use a vendored version of `rustfmt` --# that we're shipping as well (to ensure that the rustfmt in RLS and the --# `rustfmt` executable are the same exact version). --rustfmt-nightly = { path = "src/tools/rustfmt" } -+# The only package that ever uses debug builds is bootstrap. -+# We care a lot about bootstrap's compile times, so don't include debug info for -+# dependencies, only bootstrap itself. -+[profile.dev] -+debug = 0 -+[profile.dev.package] -+# Only use debuginfo=1 to further reduce compile times. -+bootstrap.debug = 1 - [patch.crates-io] -# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on -# here @@ -78,7 +57,7 @@ index ffc886d..7231b60 100644 # See comments in `library/rustc-std-workspace-core/README.md` for what's going on # here diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py -index 03eec02..c40811f 100644 +index cc08ae5..bf7d696 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -759,10 +759,6 @@ class RustBuild(object): @@ -93,34 +72,36 @@ index 03eec02..c40811f 100644 args.append("--features") args.append("build-metrics") diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 0ab4824..629e1bb 100644 +index 14e8ebd..6d43333 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs -@@ -600,7 +600,6 @@ impl<'a> Builder<'a> { +@@ -600,8 +600,6 @@ impl<'a> Builder<'a> { + tool::RemoteTestClient, tool::RustInstaller, tool::Cargo, - tool::Rls, +- tool::Rls, - tool::RustAnalyzer, tool::RustAnalyzerProcMacroSrv, tool::RustDemangler, tool::Rustdoc, -@@ -622,7 +620,6 @@ impl<'a> Builder<'a> { +@@ -622,8 +621,6 @@ impl<'a> Builder<'a> { + check::CodegenBackend, check::Clippy, check::Miri, - check::Rls, +- check::Rls, - check::RustAnalyzer, check::Rustfmt, check::Bootstrap ), -@@ -650,7 +647,6 @@ impl<'a> Builder<'a> { +@@ -650,7 +648,6 @@ impl<'a> Builder<'a> { + test::ReplacePlaceholderTest, test::Cargotest, test::Cargo, - test::Rls, - test::RustAnalyzer, test::ErrorIndex, test::Distcheck, test::RunMakeFullDeps, -@@ -698,10 +694,8 @@ impl<'a> Builder<'a> { +@@ -698,10 +695,8 @@ impl<'a> Builder<'a> { doc::RustdocBook, doc::RustByExample, doc::RustcBook, @@ -131,7 +112,15 @@ index 0ab4824..629e1bb 100644 doc::EmbeddedBook, doc::EditionGuide, ), -@@ -723,7 +717,6 @@ impl<'a> Builder<'a> { +@@ -715,15 +712,12 @@ impl<'a> Builder<'a> { + dist::Analysis, + dist::Src, + dist::Cargo, +- dist::Rls, +- dist::RustAnalyzer, + dist::Rustfmt, + dist::RustDemangler, + dist::Clippy, dist::Miri, dist::LlvmTools, dist::RustDev, @@ -139,7 +128,15 @@ index 0ab4824..629e1bb 100644 // It seems that PlainSourceTarball somehow changes how some of the tools // perceive their dependencies (see #93033) which would invalidate fingerprints // and force us to rebuild tools after vendoring dependencies. -@@ -2054,10 +2047,7 @@ impl<'a> Builder<'a> { +@@ -736,7 +725,6 @@ impl<'a> Builder<'a> { + install::Docs, + install::Std, + install::Cargo, +- install::RustAnalyzer, + install::Rustfmt, + install::RustDemangler, + install::Clippy, +@@ -2056,10 +2050,7 @@ impl<'a> Builder<'a> { } } @@ -152,7 +149,7 @@ index 0ab4824..629e1bb 100644 } diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs -index 2852442..5faa8e5 100644 +index f909ecc..8bf71b1 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -73,7 +73,6 @@ macro_rules! book { @@ -164,10 +161,10 @@ index 2852442..5faa8e5 100644 EditionGuide, "src/doc/edition-guide", "edition-guide", submodule; EmbeddedBook, "src/doc/embedded-book", "embedded-book", submodule; diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index c0fa8c9..8fbc390 100644 +index dd41f84..ba6227c 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs -@@ -1910,17 +1910,7 @@ impl Step for RustcGuide { +@@ -1886,17 +1886,7 @@ impl Step for RustcGuide { } fn run(self, builder: &Builder<'_>) { @@ -187,7 +184,7 @@ index c0fa8c9..8fbc390 100644 } diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml -index 1c875c3..1aad7cf 100644 +index b7e136c..a844a5d 100644 --- a/src/tools/clippy/Cargo.toml +++ b/src/tools/clippy/Cargo.toml @@ -36,11 +36,6 @@ walkdir = "2.3" @@ -202,6 +199,26 @@ index 1c875c3..1aad7cf 100644 # UI test dependencies clippy_utils = { path = "clippy_utils" } derive-new = "0.5" +diff --git a/src/tools/rust-analyzer/Cargo.toml b/src/tools/rust-analyzer/Cargo.toml +index 6b68ca8..93f755c 100644 +--- a/src/tools/rust-analyzer/Cargo.toml ++++ b/src/tools/rust-analyzer/Cargo.toml +@@ -1,5 +1,14 @@ + [workspace] +-members = ["xtask/", "lib/*", "crates/*"] ++members = [ ++ "xtask/", ++ "lib/*", ++ "crates/proc-macro-srv", ++ "crates/proc-macro-srv-cli", ++ "crates/tt", ++ "crates/mbe", ++ "crates/paths", ++ "crates/proc-macro-api", ++] + exclude = ["crates/proc-macro-test/imp"] + + [profile.dev] diff --git a/src/tools/rustfmt/Cargo.toml b/src/tools/rustfmt/Cargo.toml index 7a4e02d..27b91f2 100644 --- a/src/tools/rustfmt/Cargo.toml @@ -219,10 +236,10 @@ index 7a4e02d..27b91f2 100644 [package.metadata.rust-analyzer] diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs -index 333f85f..4df2b54 100644 +index cbd8cfa..6b39fd6 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs -@@ -306,7 +306,7 @@ const FORBIDDEN_TO_HAVE_DUPLICATES: &[&str] = &[ +@@ -308,7 +308,7 @@ const FORBIDDEN_TO_HAVE_DUPLICATES: &[&str] = &[ // These two crates take quite a long time to build, so don't allow two versions of them // to accidentally sneak into our dependency graph, in order to ensure we keep our CI times // under control. @@ -231,23 +248,3 @@ index 333f85f..4df2b54 100644 ]; /// Dependency checks. -diff --git a/src/tools/rust-analyzer/Cargo.toml b/src.tools/rust-analyzer/Cargo.toml -index 6b68ca82389..7bc5d1bc5a0 100644 ---- a/src/tools/rust-analyzer/Cargo.toml -+++ b/src/tools/rust-analyzer/Cargo.toml -@@ -1,5 +1,14 @@ - [workspace] --members = ["xtask/", "lib/*", "crates/*"] -+members = [ -+ "xtask/", -+ "lib/*", -+ "crates/proc-macro-srv", -+ "crates/proc-macro-srv-cli", -+ "crates/tt", -+ "crates/mbe", -+ "crates/paths", -+ "crates/proc-macro-api", -+] - exclude = ["crates/proc-macro-test/imp"] - - [profile.dev] diff --git a/debian/patches/d-0004-clippy-feature-sync.patch b/debian/patches/d-0004-clippy-feature-sync.patch index 8c0c0fb97..19c75955e 100644 --- a/debian/patches/d-0004-clippy-feature-sync.patch +++ b/debian/patches/d-0004-clippy-feature-sync.patch @@ -5,15 +5,15 @@ Subject: d-0004-clippy-feature-sync enable features needed by rustfmt to make build system happy and speedup build. this is what rustc_workspace_hack does in the upstream build. --- - src/tools/clippy/Cargo.toml | 3 ++- + src/tools/clippy/Cargo.toml | 2 +- src/tools/rustfmt/Cargo.toml | 2 +- - 2 files changed, 3 insertions(+), 2 deletions(-) + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml -index 1aad7cf..705a880 100644 +index a844a5d..4dd3f55 100644 --- a/src/tools/clippy/Cargo.toml +++ b/src/tools/clippy/Cargo.toml -@@ -42,7 +43,7 @@ if_chain = "1.0" +@@ -43,7 +43,7 @@ if_chain = "1.0" itertools = "0.10.1" quote = "1.0" serde = { version = "1.0.125", features = ["derive"] } diff --git a/debian/patches/d-0005-no-jemalloc.patch b/debian/patches/d-0005-no-jemalloc.patch index 6d8620a01..ca74117bd 100644 --- a/debian/patches/d-0005-no-jemalloc.patch +++ b/debian/patches/d-0005-no-jemalloc.patch @@ -3,8 +3,9 @@ Date: Sat, 2 Oct 2021 01:08:00 +0100 Subject: d-0005-no-jemalloc --- - compiler/rustc/Cargo.toml | 6 ------ - 1 file changed, 6 deletions(-) + compiler/rustc/Cargo.toml | 6 ------ + src/tools/rust-analyzer/crates/profile/Cargo.toml | 2 -- + 2 files changed, 8 deletions(-) diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index 27ee3dd..87fb29f 100644 @@ -25,7 +26,7 @@ index 27ee3dd..87fb29f 100644 max_level_info = ['rustc_driver/max_level_info'] rustc_use_parallel_compiler = ['rustc_driver/rustc_use_parallel_compiler'] diff --git a/src/tools/rust-analyzer/crates/profile/Cargo.toml b/src/tools/rust-analyzer/crates/profile/Cargo.toml -index 99d4179dc20..0b78a45a24b 100644 +index 0b78a45..99d4179 100644 --- a/src/tools/rust-analyzer/crates/profile/Cargo.toml +++ b/src/tools/rust-analyzer/crates/profile/Cargo.toml @@ -15,7 +15,6 @@ cfg-if = "1.0.0" @@ -36,7 +37,7 @@ index 99d4179dc20..0b78a45a24b 100644 [target.'cfg(target_os = "linux")'.dependencies] perf-event = "0.4.7" -@@ -24,7 +25,6 @@ winapi = { version = "0.3.9", features = ["processthreadsapi", "psapi"] } +@@ -25,7 +24,6 @@ winapi = { version = "0.3.9", features = ["processthreadsapi", "psapi"] } [features] cpu_profiler = [] diff --git a/debian/patches/d-bootstrap-cargo-check-cfg.patch b/debian/patches/d-bootstrap-cargo-check-cfg.patch index e15707199..c715b1f31 100644 --- a/debian/patches/d-bootstrap-cargo-check-cfg.patch +++ b/debian/patches/d-bootstrap-cargo-check-cfg.patch @@ -5,7 +5,7 @@ diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 0ab4824ac0a..76c476f449b 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs -@@ -1480,9 +1480,9 @@ impl<'a> Builder<'a> { +@@ -1472,9 +1472,9 @@ impl<'a> Builder<'a> { // complete list of features, so for that reason we don't enable checking of // features for std crates. cargo.arg(if mode != Mode::Std { diff --git a/debian/patches/d-bootstrap-custom-debuginfo-path.patch b/debian/patches/d-bootstrap-custom-debuginfo-path.patch index f955cffbf..2b548abcf 100644 --- a/debian/patches/d-bootstrap-custom-debuginfo-path.patch +++ b/debian/patches/d-bootstrap-custom-debuginfo-path.patch @@ -12,7 +12,7 @@ diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index ddc92ba..259b56e 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs -@@ -1023,10 +1023,9 @@ impl Build { +@@ -1026,10 +1026,9 @@ impl Build { match which { GitRepo::Rustc => { diff --git a/debian/patches/d-bootstrap-disable-git.patch b/debian/patches/d-bootstrap-disable-git.patch index ce02d60b3..63823f51b 100644 --- a/debian/patches/d-bootstrap-disable-git.patch +++ b/debian/patches/d-bootstrap-disable-git.patch @@ -31,7 +31,7 @@ diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 6181a61..5fe3600 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs -@@ -899,7 +899,10 @@ impl Step for PlainSourceTarball { +@@ -902,7 +902,10 @@ impl Step for PlainSourceTarball { } // If we're building from git sources, we need to vendor a complete distribution. diff --git a/debian/patches/d-bootstrap-read-beta-version-from-file.patch b/debian/patches/d-bootstrap-read-beta-version-from-file.patch index a5b385d13..812a653ba 100644 --- a/debian/patches/d-bootstrap-read-beta-version-from-file.patch +++ b/debian/patches/d-bootstrap-read-beta-version-from-file.patch @@ -11,7 +11,7 @@ diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 68d387b..ddc92ba 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs -@@ -1266,14 +1266,15 @@ impl Build { +@@ -1269,14 +1269,15 @@ impl Build { return s; } diff --git a/debian/patches/d-bootstrap-rustflags.patch b/debian/patches/d-bootstrap-rustflags.patch index a28810e89..dfcdee922 100644 --- a/debian/patches/d-bootstrap-rustflags.patch +++ b/debian/patches/d-bootstrap-rustflags.patch @@ -11,7 +11,7 @@ diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 23ea2fe..b2b1c54 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs -@@ -1505,6 +1505,18 @@ impl<'a> Builder<'a> { +@@ -1499,6 +1499,18 @@ impl<'a> Builder<'a> { } } diff --git a/debian/patches/d-rust-lldb-paths b/debian/patches/d-rust-lldb-paths index 15028a68f..bea7a3844 100644 --- a/debian/patches/d-rust-lldb-paths +++ b/debian/patches/d-rust-lldb-paths @@ -23,7 +23,7 @@ index bce72f1..793f593 100755 RUST_LLDB="$RUSTC_SYSROOT/lib/rustlib/$host/bin/lldb" -lldb=lldb -+lldb=lldb-14 ++lldb=lldb-15 if [ -f "$RUST_LLDB" ]; then lldb="$RUST_LLDB" else diff --git a/debian/patches/d-rustc-add-soname.patch b/debian/patches/d-rustc-add-soname.patch index 70fdf26b8..e69898bf5 100644 --- a/debian/patches/d-rustc-add-soname.patch +++ b/debian/patches/d-rustc-add-soname.patch @@ -28,7 +28,7 @@ diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codege index 04ec1e7..67296ca 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -2175,6 +2175,13 @@ fn add_order_independent_options( +@@ -2240,6 +2240,13 @@ fn add_order_independent_options( } add_rpath_args(cmd, sess, codegen_results, out_filename); diff --git a/debian/patches/d-rustc-windows-ssp.patch b/debian/patches/d-rustc-windows-ssp.patch index 5d8ba4785..bbf00594c 100644 --- a/debian/patches/d-rustc-windows-ssp.patch +++ b/debian/patches/d-rustc-windows-ssp.patch @@ -11,7 +11,7 @@ diff --git a/compiler/rustc_target/src/spec/windows_gnu_base.rs b/compiler/rustc index d11f1f7..137f8eb 100644 --- a/compiler/rustc_target/src/spec/windows_gnu_base.rs +++ b/compiler/rustc_target/src/spec/windows_gnu_base.rs -@@ -40,6 +40,8 @@ pub fn opts() -> TargetOptions { +@@ -41,6 +41,8 @@ pub fn opts() -> TargetOptions { "-lmsvcrt", "-luser32", "-lkernel32", diff --git a/debian/patches/series b/debian/patches/series index c918b658a..d3c74ae4c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,17 +4,17 @@ u-ignore-reproducible-failure.patch u-reproducible-build.patch u-ignore-endian-big-diff.patch +u-make-compiletest-work-without-rpath.patch +u-fix-backtrace-tests.patch # fixed in 1.66 # can be dropped once upstream updates compiler_builtins u-arm-compiler-builtins-weak-linkage-arm.patch -u-arm-compiler-builtins-add-sync-builtin-fallbacks.patch # can be dropped once upstream updates rustix u-fix-rustix-for-sparc64.patch # not forwarded, or forwarded but unlikely to be merged u-ignore-ppc-hangs.patch -u-ignore-bpf-test.patch u-rustc-llvm-cross-flags.patch u-reproducible-dl-stage0.patch u-make-tests-work-without-rpath.patch @@ -67,4 +67,3 @@ d-rustdoc-disable-embedded-fonts.patch # cherry-picked from ubuntu ubuntu-disable-ppc64el-asm-tests.patch ubuntu-ignore-arm-doctest.patch -ubuntu-Revert-Use-constant-eval-to-do-strict-validity-check.patch diff --git a/debian/patches/u-arm-compiler-builtins-add-sync-builtin-fallbacks.patch b/debian/patches/u-arm-compiler-builtins-add-sync-builtin-fallbacks.patch deleted file mode 100644 index 796c17cef..000000000 --- a/debian/patches/u-arm-compiler-builtins-add-sync-builtin-fallbacks.patch +++ /dev/null @@ -1,223 +0,0 @@ -From 56172fcd8bd045e38bbdf76697d1fcca1e965d6d Mon Sep 17 00:00:00 2001 -From: Alex Huszagh <ahuszagh@gmail.com> -Date: Fri, 29 Jul 2022 16:58:05 -0500 -Subject: [PATCH] Add compiler-rt fallbacks for sync builtins on armv5te-musl. - ---- -https://github.com/rust-lang/compiler-builtins/pull/484 - - src/arm_linux.rs | 110 +++++++++++++++++++++++++++++++---------------- - 1 file changed, 73 insertions(+), 37 deletions(-) - -diff --git a/vendor/compiler_builtins/src/arm_linux.rs b/vendor/compiler_builtins/src/arm_linux.rs -index 8fe0948..8f22eb6 100644 ---- a/vendor/compiler_builtins/src/arm_linux.rs -+++ b/vendor/compiler_builtins/src/arm_linux.rs -@@ -55,7 +55,7 @@ fn insert_aligned(aligned: u32, val: u32, shift: u32, mask: u32) -> u32 { - } - - // Generic atomic read-modify-write operation --unsafe fn atomic_rmw<T, F: Fn(u32) -> u32>(ptr: *mut T, f: F) -> u32 { -+unsafe fn atomic_rmw<T, F: Fn(u32) -> u32, G: Fn(u32, u32) -> u32>(ptr: *mut T, f: F, g: G) -> u32 { - let aligned_ptr = align_ptr(ptr); - let (shift, mask) = get_shift_mask(ptr); - -@@ -65,7 +65,7 @@ unsafe fn atomic_rmw<T, F: Fn(u32) -> u32>(ptr: *mut T, f: F) -> u32 { - let newval = f(curval); - let newval_aligned = insert_aligned(curval_aligned, newval, shift, mask); - if __kuser_cmpxchg(curval_aligned, newval_aligned, aligned_ptr) { -- return curval; -+ return g(curval, newval); - } - } - } -@@ -89,13 +89,21 @@ unsafe fn atomic_cmpxchg<T>(ptr: *mut T, oldval: u32, newval: u32) -> u32 { - } - - macro_rules! atomic_rmw { -- ($name:ident, $ty:ty, $op:expr) => { -+ ($name:ident, $ty:ty, $op:expr, $fetch:expr) => { - intrinsics! { - pub unsafe extern "C" fn $name(ptr: *mut $ty, val: $ty) -> $ty { -- atomic_rmw(ptr, |x| $op(x as $ty, val) as u32) as $ty -+ atomic_rmw(ptr, |x| $op(x as $ty, val) as u32, |old, new| $fetch(old, new)) as $ty - } - } - }; -+ -+ (@old $name:ident, $ty:ty, $op:expr) => { -+ atomic_rmw!($name, $ty, $op, |old, _| old); -+ }; -+ -+ (@new $name:ident, $ty:ty, $op:expr) => { -+ atomic_rmw!($name, $ty, $op, |_, new| new); -+ }; - } - macro_rules! atomic_cmpxchg { - ($name:ident, $ty:ty) => { -@@ -107,101 +115,129 @@ macro_rules! atomic_cmpxchg { - }; - } - --atomic_rmw!(__sync_fetch_and_add_1, u8, |a: u8, b: u8| a.wrapping_add(b)); --atomic_rmw!(__sync_fetch_and_add_2, u16, |a: u16, b: u16| a -+atomic_rmw!(@old __sync_fetch_and_add_1, u8, |a: u8, b: u8| a.wrapping_add(b)); -+atomic_rmw!(@old __sync_fetch_and_add_2, u16, |a: u16, b: u16| a -+ .wrapping_add(b)); -+atomic_rmw!(@old __sync_fetch_and_add_4, u32, |a: u32, b: u32| a -+ .wrapping_add(b)); -+ -+atomic_rmw!(@new __sync_add_and_fetch_1, u8, |a: u8, b: u8| a.wrapping_add(b)); -+atomic_rmw!(@new __sync_add_and_fetch_2, u16, |a: u16, b: u16| a - .wrapping_add(b)); --atomic_rmw!(__sync_fetch_and_add_4, u32, |a: u32, b: u32| a -+atomic_rmw!(@new __sync_add_and_fetch_4, u32, |a: u32, b: u32| a - .wrapping_add(b)); - --atomic_rmw!(__sync_fetch_and_sub_1, u8, |a: u8, b: u8| a.wrapping_sub(b)); --atomic_rmw!(__sync_fetch_and_sub_2, u16, |a: u16, b: u16| a -+atomic_rmw!(@old __sync_fetch_and_sub_1, u8, |a: u8, b: u8| a.wrapping_sub(b)); -+atomic_rmw!(@old __sync_fetch_and_sub_2, u16, |a: u16, b: u16| a - .wrapping_sub(b)); --atomic_rmw!(__sync_fetch_and_sub_4, u32, |a: u32, b: u32| a -+atomic_rmw!(@old __sync_fetch_and_sub_4, u32, |a: u32, b: u32| a - .wrapping_sub(b)); - --atomic_rmw!(__sync_fetch_and_and_1, u8, |a: u8, b: u8| a & b); --atomic_rmw!(__sync_fetch_and_and_2, u16, |a: u16, b: u16| a & b); --atomic_rmw!(__sync_fetch_and_and_4, u32, |a: u32, b: u32| a & b); -+atomic_rmw!(@new __sync_sub_and_fetch_1, u8, |a: u8, b: u8| a.wrapping_sub(b)); -+atomic_rmw!(@new __sync_sub_and_fetch_2, u16, |a: u16, b: u16| a -+ .wrapping_sub(b)); -+atomic_rmw!(@new __sync_sub_and_fetch_4, u32, |a: u32, b: u32| a -+ .wrapping_sub(b)); -+ -+atomic_rmw!(@old __sync_fetch_and_and_1, u8, |a: u8, b: u8| a & b); -+atomic_rmw!(@old __sync_fetch_and_and_2, u16, |a: u16, b: u16| a & b); -+atomic_rmw!(@old __sync_fetch_and_and_4, u32, |a: u32, b: u32| a & b); -+ -+atomic_rmw!(@new __sync_and_and_fetch_1, u8, |a: u8, b: u8| a & b); -+atomic_rmw!(@new __sync_and_and_fetch_2, u16, |a: u16, b: u16| a & b); -+atomic_rmw!(@new __sync_and_and_fetch_4, u32, |a: u32, b: u32| a & b); -+ -+atomic_rmw!(@old __sync_fetch_and_or_1, u8, |a: u8, b: u8| a | b); -+atomic_rmw!(@old __sync_fetch_and_or_2, u16, |a: u16, b: u16| a | b); -+atomic_rmw!(@old __sync_fetch_and_or_4, u32, |a: u32, b: u32| a | b); -+ -+atomic_rmw!(@new __sync_or_and_fetch_1, u8, |a: u8, b: u8| a | b); -+atomic_rmw!(@new __sync_or_and_fetch_2, u16, |a: u16, b: u16| a | b); -+atomic_rmw!(@new __sync_or_and_fetch_4, u32, |a: u32, b: u32| a | b); -+ -+atomic_rmw!(@old __sync_fetch_and_xor_1, u8, |a: u8, b: u8| a ^ b); -+atomic_rmw!(@old __sync_fetch_and_xor_2, u16, |a: u16, b: u16| a ^ b); -+atomic_rmw!(@old __sync_fetch_and_xor_4, u32, |a: u32, b: u32| a ^ b); - --atomic_rmw!(__sync_fetch_and_or_1, u8, |a: u8, b: u8| a | b); --atomic_rmw!(__sync_fetch_and_or_2, u16, |a: u16, b: u16| a | b); --atomic_rmw!(__sync_fetch_and_or_4, u32, |a: u32, b: u32| a | b); -+atomic_rmw!(@new __sync_xor_and_fetch_1, u8, |a: u8, b: u8| a ^ b); -+atomic_rmw!(@new __sync_xor_and_fetch_2, u16, |a: u16, b: u16| a ^ b); -+atomic_rmw!(@new __sync_xor_and_fetch_4, u32, |a: u32, b: u32| a ^ b); - --atomic_rmw!(__sync_fetch_and_xor_1, u8, |a: u8, b: u8| a ^ b); --atomic_rmw!(__sync_fetch_and_xor_2, u16, |a: u16, b: u16| a ^ b); --atomic_rmw!(__sync_fetch_and_xor_4, u32, |a: u32, b: u32| a ^ b); -+atomic_rmw!(@old __sync_fetch_and_nand_1, u8, |a: u8, b: u8| !(a & b)); -+atomic_rmw!(@old __sync_fetch_and_nand_2, u16, |a: u16, b: u16| !(a & b)); -+atomic_rmw!(@old __sync_fetch_and_nand_4, u32, |a: u32, b: u32| !(a & b)); - --atomic_rmw!(__sync_fetch_and_nand_1, u8, |a: u8, b: u8| !(a & b)); --atomic_rmw!(__sync_fetch_and_nand_2, u16, |a: u16, b: u16| !(a & b)); --atomic_rmw!(__sync_fetch_and_nand_4, u32, |a: u32, b: u32| !(a & b)); -+atomic_rmw!(@new __sync_nand_and_fetch_1, u8, |a: u8, b: u8| !(a & b)); -+atomic_rmw!(@new __sync_nand_and_fetch_2, u16, |a: u16, b: u16| !(a & b)); -+atomic_rmw!(@new __sync_nand_and_fetch_4, u32, |a: u32, b: u32| !(a & b)); - --atomic_rmw!(__sync_fetch_and_max_1, i8, |a: i8, b: i8| if a > b { -+atomic_rmw!(@old __sync_fetch_and_max_1, i8, |a: i8, b: i8| if a > b { - a - } else { - b - }); --atomic_rmw!(__sync_fetch_and_max_2, i16, |a: i16, b: i16| if a > b { -+atomic_rmw!(@old __sync_fetch_and_max_2, i16, |a: i16, b: i16| if a > b { - a - } else { - b - }); --atomic_rmw!(__sync_fetch_and_max_4, i32, |a: i32, b: i32| if a > b { -+atomic_rmw!(@old __sync_fetch_and_max_4, i32, |a: i32, b: i32| if a > b { - a - } else { - b - }); - --atomic_rmw!(__sync_fetch_and_umax_1, u8, |a: u8, b: u8| if a > b { -+atomic_rmw!(@old __sync_fetch_and_umax_1, u8, |a: u8, b: u8| if a > b { - a - } else { - b - }); --atomic_rmw!(__sync_fetch_and_umax_2, u16, |a: u16, b: u16| if a > b { -+atomic_rmw!(@old __sync_fetch_and_umax_2, u16, |a: u16, b: u16| if a > b { - a - } else { - b - }); --atomic_rmw!(__sync_fetch_and_umax_4, u32, |a: u32, b: u32| if a > b { -+atomic_rmw!(@old __sync_fetch_and_umax_4, u32, |a: u32, b: u32| if a > b { - a - } else { - b - }); - --atomic_rmw!(__sync_fetch_and_min_1, i8, |a: i8, b: i8| if a < b { -+atomic_rmw!(@old __sync_fetch_and_min_1, i8, |a: i8, b: i8| if a < b { - a - } else { - b - }); --atomic_rmw!(__sync_fetch_and_min_2, i16, |a: i16, b: i16| if a < b { -+atomic_rmw!(@old __sync_fetch_and_min_2, i16, |a: i16, b: i16| if a < b { - a - } else { - b - }); --atomic_rmw!(__sync_fetch_and_min_4, i32, |a: i32, b: i32| if a < b { -+atomic_rmw!(@old __sync_fetch_and_min_4, i32, |a: i32, b: i32| if a < b { - a - } else { - b - }); - --atomic_rmw!(__sync_fetch_and_umin_1, u8, |a: u8, b: u8| if a < b { -+atomic_rmw!(@old __sync_fetch_and_umin_1, u8, |a: u8, b: u8| if a < b { - a - } else { - b - }); --atomic_rmw!(__sync_fetch_and_umin_2, u16, |a: u16, b: u16| if a < b { -+atomic_rmw!(@old __sync_fetch_and_umin_2, u16, |a: u16, b: u16| if a < b { - a - } else { - b - }); --atomic_rmw!(__sync_fetch_and_umin_4, u32, |a: u32, b: u32| if a < b { -+atomic_rmw!(@old __sync_fetch_and_umin_4, u32, |a: u32, b: u32| if a < b { - a - } else { - b - }); - --atomic_rmw!(__sync_lock_test_and_set_1, u8, |_: u8, b: u8| b); --atomic_rmw!(__sync_lock_test_and_set_2, u16, |_: u16, b: u16| b); --atomic_rmw!(__sync_lock_test_and_set_4, u32, |_: u32, b: u32| b); -+atomic_rmw!(@old __sync_lock_test_and_set_1, u8, |_: u8, b: u8| b); -+atomic_rmw!(@old __sync_lock_test_and_set_2, u16, |_: u16, b: u16| b); -+atomic_rmw!(@old __sync_lock_test_and_set_4, u32, |_: u32, b: u32| b); - - atomic_cmpxchg!(__sync_val_compare_and_swap_1, u8); - atomic_cmpxchg!(__sync_val_compare_and_swap_2, u16); --- -2.39.0 - diff --git a/debian/patches/u-fix-backtrace-tests.patch b/debian/patches/u-fix-backtrace-tests.patch new file mode 100644 index 000000000..9a5617ad1 --- /dev/null +++ b/debian/patches/u-fix-backtrace-tests.patch @@ -0,0 +1,54 @@ +From 3d8b3e6ca179dc2ac79c038ad607b2321be70e8d Mon Sep 17 00:00:00 2001 +From: Aaron Hill <aa1ronham@gmail.com> +Date: Wed, 21 Sep 2022 10:24:16 -0500 +Subject: [PATCH] Set 'exec-env:RUST_BACKTRACE=0' in const-eval-select tests + +This allows the tests to pass even if the user has RUST_BACKTRACE +set when running 'x.py' +--- + src/test/ui/intrinsics/const-eval-select-backtrace-std.rs | 1 + + .../ui/intrinsics/const-eval-select-backtrace-std.run.stderr | 2 +- + src/test/ui/intrinsics/const-eval-select-backtrace.rs | 1 + + src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr | 2 +- + 4 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs b/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs +index 29aefe07162b3..1164a3a5b0180 100644 +--- a/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs ++++ b/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs +@@ -1,6 +1,7 @@ + // See issue #100696. + // run-fail + // check-run-results ++// exec-env:RUST_BACKTRACE=0 + fn main() { + &""[1..]; + } +diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr b/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr +index e53e6034620ca..463cd52c5aa7b 100644 +--- a/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr ++++ b/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr +@@ -1,2 +1,2 @@ +-thread 'main' panicked at 'byte index 1 is out of bounds of ``', $DIR/const-eval-select-backtrace-std.rs:5:6 ++thread 'main' panicked at 'byte index 1 is out of bounds of ``', $DIR/const-eval-select-backtrace-std.rs:6:6 + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace.rs b/src/test/ui/intrinsics/const-eval-select-backtrace.rs +index 99f0725200c1d..ef1c7c4195b91 100644 +--- a/src/test/ui/intrinsics/const-eval-select-backtrace.rs ++++ b/src/test/ui/intrinsics/const-eval-select-backtrace.rs +@@ -2,6 +2,7 @@ + // See issue #100696. + // run-fail + // check-run-results ++// exec-env:RUST_BACKTRACE=0 + + #[track_caller] + fn uhoh() { +diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr b/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr +index 2fd730ac7a68a..54e28db5e533d 100644 +--- a/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr ++++ b/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr +@@ -1,2 +1,2 @@ +-thread 'main' panicked at 'Aaah!', $DIR/const-eval-select-backtrace.rs:16:9 ++thread 'main' panicked at 'Aaah!', $DIR/const-eval-select-backtrace.rs:17:9 + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/debian/patches/u-ignore-bpf-test.patch b/debian/patches/u-ignore-bpf-test.patch deleted file mode 100644 index 5fa3464ee..000000000 --- a/debian/patches/u-ignore-bpf-test.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> -Date: Thu, 14 Jul 2022 13:17:37 +0200 -Subject: u-ignore-bpf-test - -Bug: https://github.com/rust-lang/rust/issues/89689 ---- - src/test/assembly/asm/bpf-types.rs | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/test/assembly/asm/bpf-types.rs b/src/test/assembly/asm/bpf-types.rs -index 3428d93..0e129a7 100644 ---- a/src/test/assembly/asm/bpf-types.rs -+++ b/src/test/assembly/asm/bpf-types.rs -@@ -1,3 +1,4 @@ -+// ignore-test - // min-llvm-version: 13.0 - // assembly-output: emit-asm - // compile-flags: --target bpfel-unknown-none -C target_feature=+alu32 diff --git a/debian/patches/u-make-compiletest-work-without-rpath.patch b/debian/patches/u-make-compiletest-work-without-rpath.patch new file mode 100644 index 000000000..67c3badcd --- /dev/null +++ b/debian/patches/u-make-compiletest-work-without-rpath.patch @@ -0,0 +1,187 @@ +From f8a0cc2ca8a644ddb63867526711ba17cb7508c8 Mon Sep 17 00:00:00 2001 +From: Josh Stone <jistone@redhat.com> +Date: Fri, 14 Oct 2022 16:11:28 -0700 +Subject: [PATCH] compiletest: set the dylib path when gathering target cfg +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If the compiler is built with `rpath = false`, then it won't find its +own libraries unless the library search path is set. We already do that +while running the actual compiletests, but #100260 added another rustc +command for getting the target cfg. + + Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) + thread 'main' panicked at 'error: failed to get cfg info from "[...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" + --- stdout + + --- stderr + [...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-a2a76dc626cd02d2.so: cannot open shared object file: No such file or directory + ', src/tools/compiletest/src/common.rs:476:13 + +Now the library path is set here as well, so it works without rpath. + +FG: Context adapted + +Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> +--- + src/tools/compiletest/src/common.rs | 18 +++++++++++------- + src/tools/compiletest/src/runtest.rs | 27 +++------------------------ + src/tools/compiletest/src/util.rs | 23 +++++++++++++++++++++++ + 3 files changed, 37 insertions(+), 31 deletions(-) + +diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs +index 64df76e2772..98a35810cfd 100644 +--- a/src/tools/compiletest/src/common.rs ++++ b/src/tools/compiletest/src/common.rs +@@ -2,11 +2,12 @@ pub use self::Mode::*; + + use std::ffi::OsString; + use std::fmt; ++use std::iter; + use std::path::{Path, PathBuf}; + use std::process::Command; + use std::str::FromStr; + +-use crate::util::PathBufExt; ++use crate::util::{add_dylib_path, PathBufExt}; + use lazycell::LazyCell; + use test::ColorConfig; + +@@ -389,7 +390,7 @@ impl Config { + } + + fn target_cfg(&self) -> &TargetCfg { +- self.target_cfg.borrow_with(|| TargetCfg::new(&self.rustc_path, &self.target)) ++ self.target_cfg.borrow_with(|| TargetCfg::new(self)) + } + + pub fn matches_arch(&self, arch: &str) -> bool { +@@ -455,20 +456,22 @@ pub enum Endian { + } + + impl TargetCfg { +- fn new(rustc_path: &Path, target: &str) -> TargetCfg { +- let output = match Command::new(rustc_path) ++ fn new(config: &Config) -> TargetCfg { ++ let mut command = Command::new(&config.rustc_path); ++ add_dylib_path(&mut command, iter::once(&config.compile_lib_path)); ++ let output = match command + .arg("--print=cfg") + .arg("--target") +- .arg(target) ++ .arg(&config.target) + .output() + { + Ok(output) => output, +- Err(e) => panic!("error: failed to get cfg info from {:?}: {e}", rustc_path), ++ Err(e) => panic!("error: failed to get cfg info from {:?}: {e}", config.rustc_path), + }; + if !output.status.success() { + panic!( + "error: failed to get cfg info from {:?}\n--- stdout\n{}\n--- stderr\n{}", +- rustc_path, ++ config.rustc_path, + String::from_utf8(output.stdout).unwrap(), + String::from_utf8(output.stderr).unwrap(), + ); +diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs +index 8f289876f73..eb467170249 100644 +--- a/src/tools/compiletest/src/runtest.rs ++++ b/src/tools/compiletest/src/runtest.rs +@@ -13,7 +13,7 @@ use crate::errors::{self, Error, ErrorKind}; + use crate::header::TestProps; + use crate::json; + use crate::read2::read2_abbreviated; +-use crate::util::{logv, PathBufExt}; ++use crate::util::{add_dylib_path, dylib_env_var, logv, PathBufExt}; + use crate::ColorConfig; + use regex::{Captures, Regex}; + use rustfix::{apply_suggestions, get_suggestions_from_json, Filter}; +@@ -26,6 +26,7 @@ use std::fs::{self, create_dir_all, File, OpenOptions}; + use std::hash::{Hash, Hasher}; + use std::io::prelude::*; + use std::io::{self, BufReader}; ++use std::iter; + use std::path::{Path, PathBuf}; + use std::process::{Child, Command, ExitStatus, Output, Stdio}; + use std::str; +@@ -72,19 +73,6 @@ fn disable_error_reporting<F: FnOnce() -> R, R>(f: F) -> R { + f() + } + +-/// The name of the environment variable that holds dynamic library locations. +-pub fn dylib_env_var() -> &'static str { +- if cfg!(windows) { +- "PATH" +- } else if cfg!(target_os = "macos") { +- "DYLD_LIBRARY_PATH" +- } else if cfg!(target_os = "haiku") { +- "LIBRARY_PATH" +- } else { +- "LD_LIBRARY_PATH" +- } +-} +- + /// The platform-specific library name + pub fn get_lib_name(lib: &str, dylib: bool) -> String { + // In some casess (e.g. MUSL), we build a static +@@ -1826,16 +1814,7 @@ impl<'test> TestCx<'test> { + + // Need to be sure to put both the lib_path and the aux path in the dylib + // search path for the child. +- let mut path = +- env::split_paths(&env::var_os(dylib_env_var()).unwrap_or_default()).collect::<Vec<_>>(); +- if let Some(p) = aux_path { +- path.insert(0, PathBuf::from(p)) +- } +- path.insert(0, PathBuf::from(lib_path)); +- +- // Add the new dylib search path var +- let newpath = env::join_paths(&path).unwrap(); +- command.env(dylib_env_var(), newpath); ++ add_dylib_path(&mut command, iter::once(lib_path).chain(aux_path)); + + let mut child = disable_error_reporting(|| command.spawn()) + .unwrap_or_else(|_| panic!("failed to exec `{:?}`", &command)); +diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs +index 9d047b63c85..4b73be0fbb9 100644 +--- a/src/tools/compiletest/src/util.rs ++++ b/src/tools/compiletest/src/util.rs +@@ -2,6 +2,7 @@ use crate::common::Config; + use std::env; + use std::ffi::OsStr; + use std::path::PathBuf; ++use std::process::Command; + + use tracing::*; + +@@ -105,3 +106,25 @@ impl PathBufExt for PathBuf { + } + } + } ++ ++/// The name of the environment variable that holds dynamic library locations. ++pub fn dylib_env_var() -> &'static str { ++ if cfg!(windows) { ++ "PATH" ++ } else if cfg!(target_os = "macos") { ++ "DYLD_LIBRARY_PATH" ++ } else if cfg!(target_os = "haiku") { ++ "LIBRARY_PATH" ++ } else { ++ "LD_LIBRARY_PATH" ++ } ++} ++ ++/// Adds a list of lookup paths to `cmd`'s dynamic library lookup path. ++/// If the dylib_path_var is already set for this cmd, the old value will be overwritten! ++pub fn add_dylib_path(cmd: &mut Command, paths: impl Iterator<Item = impl Into<PathBuf>>) { ++ let path_env = env::var_os(dylib_env_var()); ++ let old_paths = path_env.as_ref().map(env::split_paths); ++ let new_paths = paths.map(Into::into).chain(old_paths.into_iter().flatten()); ++ cmd.env(dylib_env_var(), env::join_paths(new_paths).unwrap()); ++} +-- +2.30.2 + diff --git a/debian/patches/u-rustc-llvm-cross-flags.patch b/debian/patches/u-rustc-llvm-cross-flags.patch index 95988249e..0e544db8e 100644 --- a/debian/patches/u-rustc-llvm-cross-flags.patch +++ b/debian/patches/u-rustc-llvm-cross-flags.patch @@ -11,7 +11,7 @@ diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs index b8f67ee..e9b1d0a 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs -@@ -294,7 +294,7 @@ fn main() { +@@ -301,7 +301,7 @@ fn main() { if let Some(stripped) = lib.strip_prefix("-LIBPATH:") { println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target)); } else if let Some(stripped) = lib.strip_prefix("-L") { diff --git a/debian/patches/ubuntu-Revert-Use-constant-eval-to-do-strict-validity-check.patch b/debian/patches/ubuntu-Revert-Use-constant-eval-to-do-strict-validity-check.patch deleted file mode 100644 index c9b50d71f..000000000 --- a/debian/patches/ubuntu-Revert-Use-constant-eval-to-do-strict-validity-check.patch +++ /dev/null @@ -1,569 +0,0 @@ -From b9e588dfeecca821a4508166027afb6bda721ed6 Mon Sep 17 00:00:00 2001 -From: Simon Chopin <simon.chopin@canonical.com> -Date: Wed, 18 Jan 2023 17:03:04 +0100 -Subject: [PATCH] Revert "Use constant eval to do strict validity checks" - -This reverts commit 27412d1e3e128349bc515c16ce882860e20f037d. - -This is likely a LLVM mis-optimization, but we're not really sure. It -leads to ICE on riscv64. - -Bug: https://github.com/rust-lang/rust/issues/102155 - ---- - Cargo.lock | 1 - - .../src/intrinsics/mod.rs | 15 ++++- - compiler/rustc_codegen_ssa/Cargo.toml | 1 - - compiler/rustc_codegen_ssa/src/mir/block.rs | 9 +-- - .../src/const_eval/machine.rs | 2 +- - .../src/interpret/intrinsics.rs | 56 ++++++++-------- - compiler/rustc_const_eval/src/lib.rs | 6 -- - .../src/might_permit_raw_init.rs | 40 ----------- - compiler/rustc_middle/src/query/mod.rs | 8 --- - compiler/rustc_middle/src/ty/query.rs | 1 - - compiler/rustc_query_impl/src/keys.rs | 12 +--- - compiler/rustc_target/src/abi/mod.rs | 38 ++++++----- - .../intrinsics/panic-uninitialized-zeroed.rs | 66 +++++++------------ - 13 files changed, 94 insertions(+), 161 deletions(-) - delete mode 100644 compiler/rustc_const_eval/src/might_permit_raw_init.rs - -diff --git a/Cargo.lock b/Cargo.lock -index 2569b3e1976..b88158f9ff8 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -3731,7 +3731,6 @@ dependencies = [ - "rustc_arena", - "rustc_ast", - "rustc_attr", -- "rustc_const_eval", - "rustc_data_structures", - "rustc_errors", - "rustc_fs_util", -diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs -index b2a83e1d4eb..4f9ced001d4 100644 ---- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs -+++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs -@@ -22,6 +22,7 @@ macro_rules! intrinsic_args { - use rustc_middle::ty::print::with_no_trimmed_paths; - use rustc_middle::ty::subst::SubstsRef; - use rustc_span::symbol::{kw, sym, Symbol}; -+use rustc_target::abi::InitKind; - - use crate::prelude::*; - use cranelift_codegen::ir::AtomicRmwOp; -@@ -693,7 +694,12 @@ fn swap(bcx: &mut FunctionBuilder<'_>, v: Value) -> Value { - return; - } - -- if intrinsic == sym::assert_zero_valid && !fx.tcx.permits_zero_init(layout) { -+ if intrinsic == sym::assert_zero_valid -+ && !layout.might_permit_raw_init( -+ fx, -+ InitKind::Zero, -+ fx.tcx.sess.opts.unstable_opts.strict_init_checks) { -+ - with_no_trimmed_paths!({ - crate::base::codegen_panic( - fx, -@@ -707,7 +713,12 @@ fn swap(bcx: &mut FunctionBuilder<'_>, v: Value) -> Value { - return; - } - -- if intrinsic == sym::assert_uninit_valid && !fx.tcx.permits_uninit_init(layout) { -+ if intrinsic == sym::assert_uninit_valid -+ && !layout.might_permit_raw_init( -+ fx, -+ InitKind::Uninit, -+ fx.tcx.sess.opts.unstable_opts.strict_init_checks) { -+ - with_no_trimmed_paths!({ - crate::base::codegen_panic( - fx, -diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml -index 46d6344dbb2..e7ee424668b 100644 ---- a/compiler/rustc_codegen_ssa/Cargo.toml -+++ b/compiler/rustc_codegen_ssa/Cargo.toml -@@ -40,7 +40,6 @@ rustc_metadata = { path = "../rustc_metadata" } - rustc_query_system = { path = "../rustc_query_system" } - rustc_target = { path = "../rustc_target" } - rustc_session = { path = "../rustc_session" } --rustc_const_eval = { path = "../rustc_const_eval" } - - [dependencies.object] - version = "0.29.0" -diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs -index 3eee58d9d1c..a9eb4ec6439 100644 ---- a/compiler/rustc_codegen_ssa/src/mir/block.rs -+++ b/compiler/rustc_codegen_ssa/src/mir/block.rs -@@ -22,7 +22,7 @@ - use rustc_span::{sym, Symbol}; - use rustc_symbol_mangling::typeid::typeid_for_fnabi; - use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode}; --use rustc_target::abi::{self, HasDataLayout, WrappingRange}; -+use rustc_target::abi::{self, HasDataLayout, InitKind, WrappingRange}; - use rustc_target::spec::abi::Abi; - - /// Used by `FunctionCx::codegen_terminator` for emitting common patterns -@@ -528,6 +528,7 @@ fn codegen_panic_intrinsic( - source_info: mir::SourceInfo, - target: Option<mir::BasicBlock>, - cleanup: Option<mir::BasicBlock>, -+ strict_validity: bool, - ) -> bool { - // Emit a panic or a no-op for `assert_*` intrinsics. - // These are intrinsics that compile to panics so that we can get a message -@@ -546,13 +547,12 @@ enum AssertIntrinsic { - }); - if let Some(intrinsic) = panic_intrinsic { - use AssertIntrinsic::*; -- - let ty = instance.unwrap().substs.type_at(0); - let layout = bx.layout_of(ty); - let do_panic = match intrinsic { - Inhabited => layout.abi.is_uninhabited(), -- ZeroValid => !bx.tcx().permits_zero_init(layout), -- UninitValid => !bx.tcx().permits_uninit_init(layout), -+ ZeroValid => !layout.might_permit_raw_init(bx, InitKind::Zero, strict_validity), -+ UninitValid => !layout.might_permit_raw_init(bx, InitKind::Uninit, strict_validity), - }; - if do_panic { - let msg_str = with_no_visible_paths!({ -@@ -687,6 +687,7 @@ fn codegen_call_terminator( - source_info, - target, - cleanup, -+ self.cx.tcx().sess.opts.unstable_opts.strict_init_checks, - ) { - return; - } -diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs -index fc2e6652a3d..ef6cff42ad9 100644 ---- a/compiler/rustc_const_eval/src/const_eval/machine.rs -+++ b/compiler/rustc_const_eval/src/const_eval/machine.rs -@@ -104,7 +104,7 @@ pub struct CompileTimeInterpreter<'mir, 'tcx> { - } - - impl<'mir, 'tcx> CompileTimeInterpreter<'mir, 'tcx> { -- pub(crate) fn new(const_eval_limit: Limit, can_access_statics: bool) -> Self { -+ pub(super) fn new(const_eval_limit: Limit, can_access_statics: bool) -> Self { - CompileTimeInterpreter { - steps_remaining: const_eval_limit.0, - stack: Vec::new(), -diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs -index 08209eb7932..e0ce6d9acc8 100644 ---- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs -+++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs -@@ -15,7 +15,7 @@ - use rustc_middle::ty::subst::SubstsRef; - use rustc_middle::ty::{Ty, TyCtxt}; - use rustc_span::symbol::{sym, Symbol}; --use rustc_target::abi::{Abi, Align, Primitive, Size}; -+use rustc_target::abi::{Abi, Align, InitKind, Primitive, Size}; - - use super::{ - util::ensure_monomorphic_enough, CheckInAllocMsg, ImmTy, InterpCx, Machine, OpTy, PlaceTy, -@@ -435,33 +435,35 @@ pub fn emulate_intrinsic( - ), - )?; - } -- -- if intrinsic_name == sym::assert_zero_valid { -- let should_panic = !self.tcx.permits_zero_init(layout); -- -- if should_panic { -- M::abort( -- self, -- format!( -- "aborted execution: attempted to zero-initialize type `{}`, which is invalid", -- ty -- ), -- )?; -- } -+ if intrinsic_name == sym::assert_zero_valid -+ && !layout.might_permit_raw_init( -+ self, -+ InitKind::Zero, -+ self.tcx.sess.opts.unstable_opts.strict_init_checks, -+ ) -+ { -+ M::abort( -+ self, -+ format!( -+ "aborted execution: attempted to zero-initialize type `{}`, which is invalid", -+ ty -+ ), -+ )?; - } -- -- if intrinsic_name == sym::assert_uninit_valid { -- let should_panic = !self.tcx.permits_uninit_init(layout); -- -- if should_panic { -- M::abort( -- self, -- format!( -- "aborted execution: attempted to leave type `{}` uninitialized, which is invalid", -- ty -- ), -- )?; -- } -+ if intrinsic_name == sym::assert_uninit_valid -+ && !layout.might_permit_raw_init( -+ self, -+ InitKind::Uninit, -+ self.tcx.sess.opts.unstable_opts.strict_init_checks, -+ ) -+ { -+ M::abort( -+ self, -+ format!( -+ "aborted execution: attempted to leave type `{}` uninitialized, which is invalid", -+ ty -+ ), -+ )?; - } - } - sym::simd_insert => { -diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs -index 72ac6af685d..d65d4f7eb72 100644 ---- a/compiler/rustc_const_eval/src/lib.rs -+++ b/compiler/rustc_const_eval/src/lib.rs -@@ -33,13 +33,11 @@ - pub mod const_eval; - mod errors; - pub mod interpret; --mod might_permit_raw_init; - pub mod transform; - pub mod util; - - use rustc_middle::ty; - use rustc_middle::ty::query::Providers; --use rustc_target::abi::InitKind; - - pub fn provide(providers: &mut Providers) { - const_eval::provide(providers); -@@ -61,8 +59,4 @@ pub fn provide(providers: &mut Providers) { - let (param_env, value) = param_env_and_value.into_parts(); - const_eval::deref_mir_constant(tcx, param_env, value) - }; -- providers.permits_uninit_init = -- |tcx, ty| might_permit_raw_init::might_permit_raw_init(tcx, ty, InitKind::Uninit); -- providers.permits_zero_init = -- |tcx, ty| might_permit_raw_init::might_permit_raw_init(tcx, ty, InitKind::Zero); - } -diff --git a/compiler/rustc_const_eval/src/might_permit_raw_init.rs b/compiler/rustc_const_eval/src/might_permit_raw_init.rs -deleted file mode 100644 -index f971c2238c7..00000000000 ---- a/compiler/rustc_const_eval/src/might_permit_raw_init.rs -+++ /dev/null -@@ -1,40 +0,0 @@ --use crate::const_eval::CompileTimeInterpreter; --use crate::interpret::{InterpCx, MemoryKind, OpTy}; --use rustc_middle::ty::layout::LayoutCx; --use rustc_middle::ty::{layout::TyAndLayout, ParamEnv, TyCtxt}; --use rustc_session::Limit; --use rustc_target::abi::InitKind; -- --pub fn might_permit_raw_init<'tcx>( -- tcx: TyCtxt<'tcx>, -- ty: TyAndLayout<'tcx>, -- kind: InitKind, --) -> bool { -- let strict = tcx.sess.opts.unstable_opts.strict_init_checks; -- -- if strict { -- let machine = CompileTimeInterpreter::new(Limit::new(0), false); -- -- let mut cx = InterpCx::new(tcx, rustc_span::DUMMY_SP, ParamEnv::reveal_all(), machine); -- -- let allocated = cx -- .allocate(ty, MemoryKind::Machine(crate::const_eval::MemoryKind::Heap)) -- .expect("OOM: failed to allocate for uninit check"); -- -- if kind == InitKind::Zero { -- cx.write_bytes_ptr( -- allocated.ptr, -- std::iter::repeat(0_u8).take(ty.layout.size().bytes_usize()), -- ) -- .expect("failed to write bytes for zero valid check"); -- } -- -- let ot: OpTy<'_, _> = allocated.into(); -- -- // Assume that if it failed, it's a validation failure. -- cx.validate_operand(&ot).is_ok() -- } else { -- let layout_cx = LayoutCx { tcx, param_env: ParamEnv::reveal_all() }; -- ty.might_permit_raw_init(&layout_cx, kind) -- } --} -diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs -index d8483e7e409..e498015a4a5 100644 ---- a/compiler/rustc_middle/src/query/mod.rs -+++ b/compiler/rustc_middle/src/query/mod.rs -@@ -2049,12 +2049,4 @@ - desc { |tcx| "looking up generator diagnostic data of `{}`", tcx.def_path_str(key) } - separate_provide_extern - } -- -- query permits_uninit_init(key: TyAndLayout<'tcx>) -> bool { -- desc { "checking to see if {:?} permits being left uninit", key.ty } -- } -- -- query permits_zero_init(key: TyAndLayout<'tcx>) -> bool { -- desc { "checking to see if {:?} permits being left zeroed", key.ty } -- } - } -diff --git a/compiler/rustc_middle/src/ty/query.rs b/compiler/rustc_middle/src/ty/query.rs -index 2452bcf6a61..3d662ed5de4 100644 ---- a/compiler/rustc_middle/src/ty/query.rs -+++ b/compiler/rustc_middle/src/ty/query.rs -@@ -28,7 +28,6 @@ - use crate::traits::specialization_graph; - use crate::traits::{self, ImplSource}; - use crate::ty::fast_reject::SimplifiedType; --use crate::ty::layout::TyAndLayout; - use crate::ty::subst::{GenericArg, SubstsRef}; - use crate::ty::util::AlwaysRequiresDrop; - use crate::ty::GeneratorDiagnosticData; -diff --git a/compiler/rustc_query_impl/src/keys.rs b/compiler/rustc_query_impl/src/keys.rs -index 49175e97f41..4d6bb02c38e 100644 ---- a/compiler/rustc_query_impl/src/keys.rs -+++ b/compiler/rustc_query_impl/src/keys.rs -@@ -6,7 +6,7 @@ - use rustc_middle::traits; - use rustc_middle::ty::fast_reject::SimplifiedType; - use rustc_middle::ty::subst::{GenericArg, SubstsRef}; --use rustc_middle::ty::{self, layout::TyAndLayout, Ty, TyCtxt}; -+use rustc_middle::ty::{self, Ty, TyCtxt}; - use rustc_span::symbol::{Ident, Symbol}; - use rustc_span::{Span, DUMMY_SP}; - -@@ -395,16 +395,6 @@ fn default_span(&self, _: TyCtxt<'_>) -> Span { - } - } - --impl<'tcx> Key for TyAndLayout<'tcx> { -- #[inline(always)] -- fn query_crate_is_local(&self) -> bool { -- true -- } -- fn default_span(&self, _: TyCtxt<'_>) -> Span { -- DUMMY_SP -- } --} -- - impl<'tcx> Key for (Ty<'tcx>, Ty<'tcx>) { - #[inline(always)] - fn query_crate_is_local(&self) -> bool { -diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs -index 92ce4d91d84..d103a06060d 100644 ---- a/compiler/rustc_target/src/abi/mod.rs -+++ b/compiler/rustc_target/src/abi/mod.rs -@@ -1378,7 +1378,7 @@ pub struct PointeeInfo { - - /// Used in `might_permit_raw_init` to indicate the kind of initialisation - /// that is checked to be valid --#[derive(Copy, Clone, Debug, PartialEq, Eq)] -+#[derive(Copy, Clone, Debug)] - pub enum InitKind { - Zero, - Uninit, -@@ -1493,18 +1493,14 @@ pub fn is_zst(&self) -> bool { - /// - /// `init_kind` indicates if the memory is zero-initialized or left uninitialized. - /// -- /// This code is intentionally conservative, and will not detect -- /// * zero init of an enum whose 0 variant does not allow zero initialization -- /// * making uninitialized types who have a full valid range (ints, floats, raw pointers) -- /// * Any form of invalid value being made inside an array (unless the value is uninhabited) -+ /// `strict` is an opt-in debugging flag added in #97323 that enables more checks. - /// -- /// A strict form of these checks that uses const evaluation exists in -- /// `rustc_const_eval::might_permit_raw_init`, and a tracking issue for making these checks -- /// stricter is <https://github.com/rust-lang/rust/issues/66151>. -+ /// This is conservative: in doubt, it will answer `true`. - /// -- /// FIXME: Once all the conservatism is removed from here, and the checks are ran by default, -- /// we can use the const evaluation checks always instead. -- pub fn might_permit_raw_init<C>(self, cx: &C, init_kind: InitKind) -> bool -+ /// FIXME: Once we removed all the conservatism, we could alternatively -+ /// create an all-0/all-undef constant and run the const value validator to see if -+ /// this is a valid value for the given type. -+ pub fn might_permit_raw_init<C>(self, cx: &C, init_kind: InitKind, strict: bool) -> bool - where - Self: Copy, - Ty: TyAbiInterface<'a, C>, -@@ -1517,8 +1513,13 @@ pub fn might_permit_raw_init<C>(self, cx: &C, init_kind: InitKind) -> bool - s.valid_range(cx).contains(0) - } - InitKind::Uninit => { -- // The range must include all values. -- s.is_always_valid(cx) -+ if strict { -+ // The type must be allowed to be uninit (which means "is a union"). -+ s.is_uninit_valid() -+ } else { -+ // The range must include all values. -+ s.is_always_valid(cx) -+ } - } - } - }; -@@ -1539,12 +1540,19 @@ pub fn might_permit_raw_init<C>(self, cx: &C, init_kind: InitKind) -> bool - // If we have not found an error yet, we need to recursively descend into fields. - match &self.fields { - FieldsShape::Primitive | FieldsShape::Union { .. } => {} -- FieldsShape::Array { .. } => { -+ FieldsShape::Array { count, .. } => { - // FIXME(#66151): For now, we are conservative and do not check arrays by default. -+ if strict -+ && *count > 0 -+ && !self.field(cx, 0).might_permit_raw_init(cx, init_kind, strict) -+ { -+ // Found non empty array with a type that is unhappy about this kind of initialization -+ return false; -+ } - } - FieldsShape::Arbitrary { offsets, .. } => { - for idx in 0..offsets.len() { -- if !self.field(cx, idx).might_permit_raw_init(cx, init_kind) { -+ if !self.field(cx, idx).might_permit_raw_init(cx, init_kind, strict) { - // We found a field that is unhappy with this kind of initialization. - return false; - } -diff --git a/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs b/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs -index 255151a9603..3ffd35ecdb8 100644 ---- a/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs -+++ b/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs -@@ -57,13 +57,6 @@ enum LR_NonZero { - - struct ZeroSized; - --#[allow(dead_code)] --#[repr(i32)] --enum ZeroIsValid { -- Zero(u8) = 0, -- One(NonNull<()>) = 1, --} -- - fn test_panic_msg<T>(op: impl (FnOnce() -> T) + panic::UnwindSafe, msg: &str) { - let err = panic::catch_unwind(op).err(); - assert_eq!( -@@ -159,12 +152,33 @@ fn main() { - "attempted to zero-initialize type `*const dyn core::marker::Send`, which is invalid" - ); - -+ /* FIXME(#66151) we conservatively do not error here yet. -+ test_panic_msg( -+ || mem::uninitialized::<LR_NonZero>(), -+ "attempted to leave type `LR_NonZero` uninitialized, which is invalid" -+ ); -+ test_panic_msg( -+ || mem::zeroed::<LR_NonZero>(), -+ "attempted to zero-initialize type `LR_NonZero`, which is invalid" -+ ); -+ -+ test_panic_msg( -+ || mem::uninitialized::<ManuallyDrop<LR_NonZero>>(), -+ "attempted to leave type `std::mem::ManuallyDrop<LR_NonZero>` uninitialized, \ -+ which is invalid" -+ ); -+ test_panic_msg( -+ || mem::zeroed::<ManuallyDrop<LR_NonZero>>(), -+ "attempted to zero-initialize type `std::mem::ManuallyDrop<LR_NonZero>`, \ -+ which is invalid" -+ ); -+ */ -+ - test_panic_msg( - || mem::uninitialized::<(NonNull<u32>, u32, u32)>(), - "attempted to leave type `(core::ptr::non_null::NonNull<u32>, u32, u32)` uninitialized, \ - which is invalid" - ); -- - test_panic_msg( - || mem::zeroed::<(NonNull<u32>, u32, u32)>(), - "attempted to zero-initialize type `(core::ptr::non_null::NonNull<u32>, u32, u32)`, \ -@@ -182,23 +196,11 @@ fn main() { - which is invalid" - ); - -- test_panic_msg( -- || mem::uninitialized::<LR_NonZero>(), -- "attempted to leave type `LR_NonZero` uninitialized, which is invalid" -- ); -- -- test_panic_msg( -- || mem::uninitialized::<ManuallyDrop<LR_NonZero>>(), -- "attempted to leave type `core::mem::manually_drop::ManuallyDrop<LR_NonZero>` uninitialized, \ -- which is invalid" -- ); -- - test_panic_msg( - || mem::uninitialized::<NoNullVariant>(), - "attempted to leave type `NoNullVariant` uninitialized, \ - which is invalid" - ); -- - test_panic_msg( - || mem::zeroed::<NoNullVariant>(), - "attempted to zero-initialize type `NoNullVariant`, \ -@@ -210,12 +212,10 @@ fn main() { - || mem::uninitialized::<bool>(), - "attempted to leave type `bool` uninitialized, which is invalid" - ); -- - test_panic_msg( - || mem::uninitialized::<LR>(), - "attempted to leave type `LR` uninitialized, which is invalid" - ); -- - test_panic_msg( - || mem::uninitialized::<ManuallyDrop<LR>>(), - "attempted to leave type `core::mem::manually_drop::ManuallyDrop<LR>` uninitialized, which is invalid" -@@ -229,7 +229,6 @@ fn main() { - let _val = mem::zeroed::<Option<&'static i32>>(); - let _val = mem::zeroed::<MaybeUninit<NonNull<u32>>>(); - let _val = mem::zeroed::<[!; 0]>(); -- let _val = mem::zeroed::<ZeroIsValid>(); - let _val = mem::uninitialized::<MaybeUninit<bool>>(); - let _val = mem::uninitialized::<[!; 0]>(); - let _val = mem::uninitialized::<()>(); -@@ -260,33 +259,12 @@ fn main() { - || mem::zeroed::<[NonNull<()>; 1]>(), - "attempted to zero-initialize type `[core::ptr::non_null::NonNull<()>; 1]`, which is invalid" - ); -- -- // FIXME(#66151) we conservatively do not error here yet (by default). -- test_panic_msg( -- || mem::zeroed::<LR_NonZero>(), -- "attempted to zero-initialize type `LR_NonZero`, which is invalid" -- ); -- -- test_panic_msg( -- || mem::zeroed::<ManuallyDrop<LR_NonZero>>(), -- "attempted to zero-initialize type `core::mem::manually_drop::ManuallyDrop<LR_NonZero>`, \ -- which is invalid" -- ); - } else { - // These are UB because they have not been officially blessed, but we await the resolution - // of <https://github.com/rust-lang/unsafe-code-guidelines/issues/71> before doing - // anything about that. - let _val = mem::uninitialized::<i32>(); - let _val = mem::uninitialized::<*const ()>(); -- -- // These are UB, but best to test them to ensure we don't become unintentionally -- // stricter. -- -- // It's currently unchecked to create invalid enums and values inside arrays. -- let _val = mem::zeroed::<LR_NonZero>(); -- let _val = mem::zeroed::<[LR_NonZero; 1]>(); -- let _val = mem::zeroed::<[NonNull<()>; 1]>(); -- let _val = mem::uninitialized::<[NonNull<()>; 1]>(); - } - } - } --- -2.37.2 - diff --git a/debian/patches/ubuntu-disable-ppc64el-asm-tests.patch b/debian/patches/ubuntu-disable-ppc64el-asm-tests.patch index bc841cc8b..001305b6e 100644 --- a/debian/patches/ubuntu-disable-ppc64el-asm-tests.patch +++ b/debian/patches/ubuntu-disable-ppc64el-asm-tests.patch @@ -1,6 +1,6 @@ --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs -@@ -2749,11 +2749,13 @@ +@@ -2913,11 +2913,13 @@ declare_lint! { /// /// use std::arch::asm; /// @@ -17,7 +17,7 @@ --- a/src/test/run-make-fulldeps/intrinsic-unreachable/Makefile +++ b/src/test/run-make-fulldeps/intrinsic-unreachable/Makefile @@ -1,6 +1,7 @@ - -include ../tools.mk + include ../tools.mk # ignore-windows-msvc +# needs-asm-support @@ -26,7 +26,7 @@ # https://github.com/llvm-mirror/llvm/commit/64b2297786f7fd6f5fa24cdd4db0298fbf211466 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs -@@ -3136,6 +3136,10 @@ +@@ -3053,6 +3053,10 @@ declare_lint! { /// ### Example /// /// ```rust,compile_fail |