Change __rust_no_alloc_shim_is_unstable to be a function
This fixes a long sequence of issues:
- A customer reported that building for Arm64EC was broken: #138541
- This was caused by a bug in my original implementation of Arm64EC support, namely that only functions on Arm64EC need to be decorated with
#but Rust was decorating statics as well. - Once I corrected Rust to only decorate functions, I started linking failures where the linker couldn't find statics exported by dylib dependencies. This was caused by the compiler not marking exported statics in the generated DEF file with
DATA, thus they were being exported as functions not data. - Once I corrected the way that the DEF files were being emitted, the linker started failing saying that it couldn't find
__rust_no_alloc_shim_is_unstable. This is because the MSVC linker requires the declarations of statics imported from other dylibs to be marked withdllimport(whereas it will happily link to functions imported from other dylibs whether they are markeddllimportor not). - I then made a change to ensure that
__rust_no_alloc_shim_is_unstablewas marked asdllimport, but the MSVC linker started emitting warnings that__rust_no_alloc_shim_is_unstablewas marked asdllimportbut was declared in an obj file. This is a harmless warning which is a performance hint: anything that's markeddllimportmust be indirected via an__impsymbol so I added a linker arg in the target to suppress the warning. - A customer then reported a similar warning when using
lld-link(https://github.com/rust-lang/rust/pull/140176#issuecomment-2872448443). I don't think it was an implementation difference between the two linkers but rather that, depending on the obj that the declaration versus uses of__rust_no_alloc_shim_is_unstablelanded in we would get different warnings, so I suppressed that warning as well: #140954. - Another customer reported that they weren't using the Rust compiler to invoke the linker, thus these warnings were breaking their build: https://github.com/rust-lang/rust/pull/140176#issuecomment-2881867433. At that point, my original change was reverted (#141024) leaving Arm64EC broken yet again.
Taking a step back, a lot of these linker issues arise from the fact that __rust_no_alloc_shim_is_unstable is marked as extern "Rust" in the standard library and, therefore, assumed to be a foreign item from a different crate BUT the Rust compiler may choose to generate it either in the current crate, some other crate that will be statically linked in OR some other crate that will by dynamically imported.
Worse yet, it is impossible while building a given crate to know if __rust_no_alloc_shim_is_unstable will statically linked or dynamically imported: it might be that one of its dependent crates is the one with an allocator kind set and thus that crate (which is compiled later) will decide depending if it has any dylib dependencies or not to import __rust_no_alloc_shim_is_unstable or generate it. Thus, there is no way to know if the declaration of __rust_no_alloc_shim_is_unstable should be marked with dllimport or not.
There is a simple fix for all this: there is no reason __rust_no_alloc_shim_is_unstable must be a static. It needs to be some symbol that must be linked in; thus, it could easily be a function instead. As a function, there is no need to mark it as dllimport when dynamically imported which avoids the entire mess above.
There may be a perf hit for changing the volatile load to be a tail call, so I'm happy to change that part back (although I question what the codegen of a volatile load would look like, and if the backend is going to try to use load-acquire semantics).
Build with this change applied BEFORE #140176 was reverted to demonstrate that there are no linking issues with either MSVC or MinGW: https://github.com/rust-lang/rust/actions/runs/15078657205
Incidentally, I fixed tests/run-make/no-alloc-shim to work with MSVC as I needed it to be able to test locally (FYI for #128602)
r? @bjorn3 cc @jieyouxu
The job x86_64-msvc-2 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
fmt: skipped untracked file ninja/
fmt: skipped untracked file sccache/
fmt: skipped untracked file wix/
fmt: skipped untracked file wix311-binaries.zip
Diff in \\?\D:\a\rust\rust\compiler\rustc_target\src\spec\base\msvc.rs:5:
pub(crate) fn opts() -> TargetOptions {
// Suppress the verbose logo and authorship debugging output, which would needlessly
// clog any log files.
- let pre_link_args = TargetOptions::link_args(
- LinkerFlavor::Msvc(Lld::No),
- &["/NOLOGO"],
- );
+ let pre_link_args = TargetOptions::link_args(LinkerFlavor::Msvc(Lld::No), &["/NOLOGO"]);
TargetOptions {
linker_flavor: LinkerFlavor::Msvc(Lld::No),
fmt: checked 6014 files
Diff in \\?\D:\a\rust\rust\compiler\rustc_codegen_gcc\src\allocator.rs:81:
let value = context.new_rvalue_from_int(i8, value as i32);
global.global_set_initializer_rvalue(value);
- create_wrapper_function(tcx, context, &mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE), None, &[], None);
+ create_wrapper_function(
+ tcx,
+ context,
+ &mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE),
+ None,
+ &[],
+ None,
+ );
}
fn create_wrapper_function(
Diff in \\?\D:\a\rust\rust\compiler\rustc_codegen_cranelift\src\allocator.rs:104:
params: vec![],
returns: vec![],
};
- let func_id = module.declare_function(&mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE), Linkage::Export, &sig).unwrap();
+ let func_id = module
+ .declare_function(
+ &mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE),
+ Linkage::Export,
+ &sig,
+ )
+ .unwrap();
let mut ctx = Context::new();
ctx.func.signature = sig;
Build completed unsuccessfully in 0:01:30
make: *** [Makefile:115: ci-msvc-ps1] Error 1
local time: Thu May 15 23:48:00 CUT 2025
network time: Thu, 15 May 2025 23:48:00 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version
The job x86_64-msvc-1 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
failures:
---- [codegen] tests\codegen\alloc-optimisation.rs stdout ----
error: verification with 'FileCheck' failed
status: exit code: 1
command: PATH=";C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64;D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage0-bootstrap-tools\x86_64-pc-windows-msvc\release\deps;D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage0\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;D:\a\rust\rust\ninja;D:\a\rust\rust\sccache;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.5.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.4.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.24.3\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.452-9\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.9\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\llvm\\build\\bin\\FileCheck.exe" "--input-file" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\test\\codegen\\alloc-optimisation\\alloc-optimisation.ll" "D:\\a\\rust\\rust\\tests\\codegen\\alloc-optimisation.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
D:\a\rust\rust\tests\codegen\alloc-optimisation.rs:8:17: error: CHECK-NEXT: expected string not found in input
// CHECK-NEXT: {{.*}} load volatile i8, ptr @{{.*}}__rust_no_alloc_shim_is_unstable, align 1
^
D:\a\rust\rust\build\x86_64-pc-windows-msvc\test\codegen\alloc-optimisation\alloc-optimisation.ll:8:7: note: scanning from here
start:
^
D:\a\rust\rust\build\x86_64-pc-windows-msvc\test\codegen\alloc-optimisation\alloc-optimisation.ll:9:2: note: possible intended match here
tail call void @__rust_no_alloc_shim_is_unstable() #2
^
Input file: D:\a\rust\rust\build\x86_64-pc-windows-msvc\test\codegen\alloc-optimisation\alloc-optimisation.ll
Check file: D:\a\rust\rust\tests\codegen\alloc-optimisation.rs
-dump-input=help explains the following input dump.
Input was:
<<<<<<
1: ; ModuleID = 'alloc_optimisation.fb2b771263244819-cgu.0'
2: source_filename = "alloc_optimisation.fb2b771263244819-cgu.0"
3: target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
4: target triple = "x86_64-pc-windows-msvc"
5:
6: ; Function Attrs: nounwind uwtable
7: define void @alloc_test(i32 noundef %data) unnamed_addr #0 personality ptr @__CxxFrameHandler3 {
8: start:
next:8'0 X error: no match found
9: tail call void @__rust_no_alloc_shim_is_unstable() #2
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:8'1 ? possible intended match
10: ret void
next:8'0 ~~~~~~~~~~
11: }
next:8'0 ~~
12:
next:8'0 ~
13: declare i32 @__CxxFrameHandler3(...) unnamed_addr #1
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14:
next:8'0 ~
15: ; Function Attrs: nounwind uwtable
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16: declare void @__rust_no_alloc_shim_is_unstable() unnamed_addr #0
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:
next:8'0 ~
18: attributes #0 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+cx16,+sse3,+sahf" }
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19: attributes #1 = { "target-cpu"="x86-64" }
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20: attributes #2 = { nounwind }
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:
next:8'0 ~
22: !llvm.module.flags = !{!0}
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
23: !llvm.ident = !{!1}
next:8'0 ~~~~~~~~~~~~~~~~~~~~
24:
next:8'0 ~
25: !0 = !{i32 8, !"PIC Level", i32 2}
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26: !1 = !{!"rustc version 1.89.0-nightly (556d2c62c 2025-05-16)"}
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>
------------------------------------------
---- [codegen] tests\codegen\vec-iter-collect-len.rs stdout ----
error: verification with 'FileCheck' failed
status: exit code: 1
command: PATH=";C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64;D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage0-bootstrap-tools\x86_64-pc-windows-msvc\release\deps;D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage0\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;D:\a\rust\rust\ninja;D:\a\rust\rust\sccache;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.5.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.4.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.24.3\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.452-9\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.9\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\llvm\\build\\bin\\FileCheck.exe" "--input-file" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\test\\codegen\\vec-iter-collect-len\\vec-iter-collect-len.ll" "D:\\a\\rust\\rust\\tests\\codegen\\vec-iter-collect-len.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
D:\a\rust\rust\tests\codegen\vec-iter-collect-len.rs:7:16: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: call
^
D:\a\rust\rust\build\x86_64-pc-windows-msvc\test\codegen\vec-iter-collect-len\vec-iter-collect-len.ll:9:7: note: found here
tail call void @__rust_no_alloc_shim_is_unstable() #2, !noalias !2
^~~~
Input file: D:\a\rust\rust\build\x86_64-pc-windows-msvc\test\codegen\vec-iter-collect-len\vec-iter-collect-len.ll
Check file: D:\a\rust\rust\tests\codegen\vec-iter-collect-len.rs
-dump-input=help explains the following input dump.
Input was:
<<<<<<
1: ; ModuleID = 'vec_iter_collect_len.bce5977002916d42-cgu.0'
2: source_filename = "vec_iter_collect_len.bce5977002916d42-cgu.0"
3: target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
4: target triple = "x86_64-pc-windows-msvc"
5:
6: ; Function Attrs: nounwind uwtable
7: define noundef range(i64 0, 1152921504606846976) i64 @get_len() unnamed_addr #0 personality ptr @__CxxFrameHandler3 {
8: start:
9: tail call void @__rust_no_alloc_shim_is_unstable() #2, !noalias !2
not:7 !~~~ error: no match expected
10: ret i64 3
11: }
12:
13: declare i32 @__CxxFrameHandler3(...) unnamed_addr #1
14:
15: ; Function Attrs: nounwind uwtable
16: declare void @__rust_no_alloc_shim_is_unstable() unnamed_addr #0
17:
18: attributes #0 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+cx16,+sse3,+sahf" }
19: attributes #1 = { "target-cpu"="x86-64" }
20: attributes #2 = { nounwind }
21:
22: !llvm.module.flags = !{!0}
23: !llvm.ident = !{!1}
24:
25: !0 = !{i32 8, !"PIC Level", i32 2}
26: !1 = !{!"rustc version 1.89.0-nightly (556d2c62c 2025-05-16)"}
27: !2 = !{!3, !5, !7, !9, !11}
28: !3 = distinct !{!3, !4, !"_ZN5alloc7raw_vec20RawVecInner$LT$A$GT$15try_allocate_in17h1ff35ac0d4f144b0E: %_0"}
29: !4 = distinct !{!4, !"_ZN5alloc7raw_vec20RawVecInner$LT$A$GT$15try_allocate_in17h1ff35ac0d4f144b0E"}
30: !5 = distinct !{!5, !6, !"_ZN111_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter_nested..SpecFromIterNested$LT$T$C$I$GT$$GT$9from_iter17h8eefd130d96dc013E: %_0"}
31: !6 = distinct !{!6, !"_ZN111_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter_nested..SpecFromIterNested$LT$T$C$I$GT$$GT$9from_iter17h8eefd130d96dc013E"}
32: !7 = distinct !{!7, !8, !"_ZN98_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter..SpecFromIter$LT$T$C$I$GT$$GT$9from_iter17h7a73abd6431f5f28E: %_0"}
33: !8 = distinct !{!8, !"_ZN98_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter..SpecFromIter$LT$T$C$I$GT$$GT$9from_iter17h7a73abd6431f5f28E"}
34: !9 = distinct !{!9, !10, !"_ZN95_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..collect..FromIterator$LT$T$GT$$GT$9from_iter17hc48d7d774d4f6d3eE: %_0"}
35: !10 = distinct !{!10, !"_ZN95_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..collect..FromIterator$LT$T$GT$$GT$9from_iter17hc48d7d774d4f6d3eE"}
36: !11 = distinct !{!11, !12, !"_ZN4core4iter6traits8iterator8Iterator7collect17h95cb6fbd436be551E: %_0"}
37: !12 = distinct !{!12, !"_ZN4core4iter6traits8iterator8Iterator7collect17h95cb6fbd436be551E"}
>>>>>>
------------------------------------------
---- [codegen] tests\codegen\vec-optimizes-away.rs stdout ----
error: verification with 'FileCheck' failed
status: exit code: 1
command: PATH=";C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64;D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage0-bootstrap-tools\x86_64-pc-windows-msvc\release\deps;D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage0\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;D:\a\rust\rust\ninja;D:\a\rust\rust\sccache;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.5.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.4.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.24.3\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.452-9\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.9\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\llvm\\build\\bin\\FileCheck.exe" "--input-file" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\test\\codegen\\vec-optimizes-away\\vec-optimizes-away.ll" "D:\\a\\rust\\rust\\tests\\codegen\\vec-optimizes-away.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
D:\a\rust\rust\tests\codegen\vec-optimizes-away.rs:8:17: error: CHECK-NEXT: expected string not found in input
// CHECK-NEXT: {{.*}} load volatile i8, ptr @{{.*}}__rust_no_alloc_shim_is_unstable, align 1
^
D:\a\rust\rust\build\x86_64-pc-windows-msvc\test\codegen\vec-optimizes-away\vec-optimizes-away.ll:8:7: note: scanning from here
bb5.i:
^
D:\a\rust\rust\build\x86_64-pc-windows-msvc\test\codegen\vec-optimizes-away\vec-optimizes-away.ll:9:2: note: possible intended match here
tail call void @__rust_no_alloc_shim_is_unstable() #2
^
Input file: D:\a\rust\rust\build\x86_64-pc-windows-msvc\test\codegen\vec-optimizes-away\vec-optimizes-away.ll
Check file: D:\a\rust\rust\tests\codegen\vec-optimizes-away.rs
-dump-input=help explains the following input dump.
Input was:
<<<<<<
1: ; ModuleID = 'vec_optimizes_away.3cfc962a6105d131-cgu.0'
2: source_filename = "vec_optimizes_away.3cfc962a6105d131-cgu.0"
3: target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
4: target triple = "x86_64-pc-windows-msvc"
5:
6: ; Function Attrs: nounwind uwtable
7: define noundef i32 @sum_me() unnamed_addr #0 personality ptr @__CxxFrameHandler3 {
8: bb5.i:
next:8'0 X error: no match found
9: tail call void @__rust_no_alloc_shim_is_unstable() #2
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:8'1 ? possible intended match
10: ret i32 6
next:8'0 ~~~~~~~~~~~
11: }
next:8'0 ~~
12:
next:8'0 ~
13: declare i32 @__CxxFrameHandler3(...) unnamed_addr #1
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14:
next:8'0 ~
15: ; Function Attrs: nounwind uwtable
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16: declare void @__rust_no_alloc_shim_is_unstable() unnamed_addr #0
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:
next:8'0 ~
18: attributes #0 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+cx16,+sse3,+sahf" }
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19: attributes #1 = { "target-cpu"="x86-64" }
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20: attributes #2 = { nounwind }
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:
next:8'0 ~
22: !llvm.module.flags = !{!0}
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
23: !llvm.ident = !{!1}
next:8'0 ~~~~~~~~~~~~~~~~~~~~
24:
next:8'0 ~
25: !0 = !{i32 8, !"PIC Level", i32 2}
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26: !1 = !{!"rustc version 1.89.0-nightly (556d2c62c 2025-05-16)"}
next:8'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>
------------------------------------------
---
test result: FAILED. 696 passed; 3 failed; 148 ignored; 0 measured; 3 filtered out; finished in 22.91s
Some tests failed in compiletest suite=codegen mode=codegen host=x86_64-pc-windows-msvc target=x86_64-pc-windows-msvc
Build completed unsuccessfully in 1:28:50
make: *** [Makefile:113: ci-msvc-py] Error 1
local time: Fri May 16 18:33:15 CUT 2025
network time: Fri, 16 May 2025 18:33:15 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version
The job i686-msvc-1 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
failures:
---- [codegen] tests\codegen\vec-iter-collect-len.rs stdout ----
error: verification with 'FileCheck' failed
status: exit code: 1
command: PATH=";C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x86;D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-bootstrap-tools\i686-pc-windows-msvc\release\deps;D:\a\rust\rust\build\i686-pc-windows-msvc\stage0\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;D:\a\rust\rust\ninja;D:\a\rust\rust\sccache;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.5.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.4.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.24.3\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.452-9\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.9\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x86" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\llvm\\build\\bin\\FileCheck.exe" "--input-file" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\test\\codegen\\vec-iter-collect-len\\vec-iter-collect-len.ll" "D:\\a\\rust\\rust\\tests\\codegen\\vec-iter-collect-len.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
D:\a\rust\rust\tests\codegen\vec-iter-collect-len.rs:9:17: error: CHECK-NEXT: expected string not found in input
// CHECK-NEXT: ret i64 3
^
D:\a\rust\rust\build\i686-pc-windows-msvc\test\codegen\vec-iter-collect-len\vec-iter-collect-len.ll:9:52: note: scanning from here
tail call void @__rust_no_alloc_shim_is_unstable() #2, !noalias !2
^
D:\a\rust\rust\build\i686-pc-windows-msvc\test\codegen\vec-iter-collect-len\vec-iter-collect-len.ll:10:2: note: possible intended match here
ret i32 3
^
Input file: D:\a\rust\rust\build\i686-pc-windows-msvc\test\codegen\vec-iter-collect-len\vec-iter-collect-len.ll
Check file: D:\a\rust\rust\tests\codegen\vec-iter-collect-len.rs
-dump-input=help explains the following input dump.
Input was:
<<<<<<
1: ; ModuleID = 'vec_iter_collect_len.bce5977002916d42-cgu.0'
2: source_filename = "vec_iter_collect_len.bce5977002916d42-cgu.0"
3: target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32"
4: target triple = "i686-pc-windows-msvc"
5:
6: ; Function Attrs: nounwind uwtable
7: define noundef range(i32 0, 536870912) i32 @get_len() unnamed_addr #0 personality ptr @__CxxFrameHandler3 {
8: start:
9: tail call void @__rust_no_alloc_shim_is_unstable() #2, !noalias !2
next:9'0 X~~~~~~~~~~~~~~~~ error: no match found
10: ret i32 3
next:9'0 ~~~~~~~~~~~
next:9'1 ? possible intended match
11: }
next:9'0 ~~
12:
next:9'0 ~
13: declare i32 @__CxxFrameHandler3(...) unnamed_addr #1
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14:
next:9'0 ~
15: ; Function Attrs: nounwind uwtable
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16: declare void @__rust_no_alloc_shim_is_unstable() unnamed_addr #0
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:
next:9'0 ~
18: attributes #0 = { nounwind uwtable "target-cpu"="pentium4" }
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19: attributes #1 = { "target-cpu"="pentium4" }
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20: attributes #2 = { nounwind }
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:
next:9'0 ~
22: !llvm.module.flags = !{!0}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
23: !llvm.ident = !{!1}
next:9'0 ~~~~~~~~~~~~~~~~~~~~
24:
next:9'0 ~
25: !0 = !{i32 8, !"PIC Level", i32 2}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26: !1 = !{!"rustc version 1.89.0-nightly (c448504d2 2025-05-16)"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27: !2 = !{!3, !5, !7, !9, !11}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28: !3 = distinct !{!3, !4, !"_ZN5alloc7raw_vec20RawVecInner$LT$A$GT$15try_allocate_in17ha4b72303663f4929E: %_0"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29: !4 = distinct !{!4, !"_ZN5alloc7raw_vec20RawVecInner$LT$A$GT$15try_allocate_in17ha4b72303663f4929E"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30: !5 = distinct !{!5, !6, !"_ZN111_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter_nested..SpecFromIterNested$LT$T$C$I$GT$$GT$9from_iter17h90e1fed75a808e7fE: %_0"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31: !6 = distinct !{!6, !"_ZN111_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter_nested..SpecFromIterNested$LT$T$C$I$GT$$GT$9from_iter17h90e1fed75a808e7fE"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32: !7 = distinct !{!7, !8, !"_ZN98_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter..SpecFromIter$LT$T$C$I$GT$$GT$9from_iter17h95a3fdb009dbb1c4E: %_0"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33: !8 = distinct !{!8, !"_ZN98_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter..SpecFromIter$LT$T$C$I$GT$$GT$9from_iter17h95a3fdb009dbb1c4E"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34: !9 = distinct !{!9, !10, !"_ZN95_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..collect..FromIterator$LT$T$GT$$GT$9from_iter17h6a38f990f998ce40E: %_0"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35: !10 = distinct !{!10, !"_ZN95_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..collect..FromIterator$LT$T$GT$$GT$9from_iter17h6a38f990f998ce40E"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36: !11 = distinct !{!11, !12, !"_ZN4core4iter6traits8iterator8Iterator7collect17h699bc61d2d641ec6E: %_0"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37: !12 = distinct !{!12, !"_ZN4core4iter6traits8iterator8Iterator7collect17h699bc61d2d641ec6E"}
next:9'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>
------------------------------------------
failures:
[codegen] tests\codegen\vec-iter-collect-len.rs
test result: FAILED. 628 passed; 1 failed; 218 ignored; 0 measured; 3 filtered out; finished in 24.19s
Some tests failed in compiletest suite=codegen mode=codegen host=i686-pc-windows-msvc target=i686-pc-windows-msvc
Build completed unsuccessfully in 1:40:51
make: *** [Makefile:113: ci-msvc-py] Error 1
local time: Fri May 16 22:26:21 CUT 2025
network time: Fri, 16 May 2025 22:26:22 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version
Do you have a link to the problems you are having?
Do you have a link to the problems you are having?
Yes, sorry, I was intending to add a full write-up to the description once I had done the PR builds to validate that this works with both MinGW and MSVC. I've updated the description now.
Some changes occurred in compiler/rustc_codegen_gcc
cc @antoyo, @GuillaumeGomez
This PR modifies run-make tests.
cc @jieyouxu
Some changes occurred in compiler/rustc_codegen_cranelift
cc @bjorn3
Some changes occurred in compiler/rustc_codegen_ssa
cc @WaffleLapkin
YAML changes were for testing. @rustbot label -T-infra
How do we handle regular
#[no_mangle]statics that doesn't cause those linker warnings/errors?
If the static is exported by one crate and referenced by another, then the compiler knows whether that static will be statically linked or dynamically imported since it can see the dependency chain between the current crate using the static and the declaring crate.
If the static is referenced via an extern block, then it is up to the user to correctly decorate it with a #[link] attribute. If they get that attribute wrong (mark it as dynamically imported when it is statically linked AND the declaration is in an obj being linked in, not an rlib) then they will see the linker warning.
The Miri subtree was changed
cc @rust-lang/miri
The job mingw-check failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Checking miri v0.1.0 (/checkout/src/tools/miri)
error[E0284]: type annotations needed
--> src/tools/miri/src/shims/foreign_items.rs:736:22
|
736 | this.check_shim(abi, Conv::Rust, link_name, args)?;
| ^^^^^^^^^^ cannot infer the value of the const parameter `N` declared on the method `check_shim`
|
note: required by a const generic parameter in `helpers::EvalContextExt::check_shim`
--> src/tools/miri/src/helpers.rs:998:23
|
998 | fn check_shim<'a, const N: usize>(
| ^^^^^^^^^^^^^^ required by this const generic parameter in `EvalContextExt::check_shim`
help: consider specifying the generic argument
|
736 | this.check_shim::<N>(abi, Conv::Rust, link_name, args)?;
| +++++
For more information about this error, try `rustc --explain E0284`.
[RUSTC-TIMING] miri test:false 3.883
error: could not compile `miri` (lib) due to 1 previous error
If the static is exported by one crate and referenced by another, then the compiler knows whether that static will be statically linked or dynamically imported since it can see the dependency chain between the current crate using the static and the declaring crate.
If the static is defined inside an rlib, and we are currently compiling an rlib, rustc can't know if the static will be statically linked or dynamically imported. Only when we are linking the current rlib into something do we know if the other rlib was statically linked or dynamically linked.
If the static is exported by one crate and referenced by another, then the compiler knows whether that static will be statically linked or dynamically imported since it can see the dependency chain between the current crate using the static and the declaring crate.
If the static is defined inside an rlib, and we are currently compiling an rlib, rustc can't know if the static will be statically linked or dynamically imported. Only when we are linking the current rlib into something do we know if the other rlib was statically linked or dynamically linked.
The warning is only emitted if something marked with dllimport is declared either in the current obj file or another obj file that is currently being linked: the MSVC linker doesn't complain if it's declared in a static library (.lib or .rlib).
The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
tests/pass/float_nan.rs ... ok
tests/pass/0weak_memory_consistency_sc.rs ... ok
FAILED TEST: tests/pass/alloc-access-tracking.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-5PykHP" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/pass" "tests/pass/alloc-access-tracking.rs" "-Zmiri-track-alloc-id=21" "-Zmiri-track-alloc-accesses" "-Cpanic=abort" "--edition" "2021"
error: actual output differed from expected
Execute `./miri test --bless` to update `tests/pass/alloc-access-tracking.stderr` to the actual output
--- tests/pass/alloc-access-tracking.stderr
+++ <stderr output>
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:LL:CC
|
-LL | let ptr = miri_alloc(123, 1);
+LL | assert_eq!(*ptr, 42);
- | ^^^^^^^^^^^^^^^^^^ created Miri bare-metal heap allocation of 123 bytes (alignment ALIGN bytes) with id $ALLOC
+ | ^^^^^^^^^^^^^^^^^^^^ created stack variable allocation of 16 bytes (alignment ALIGN bytes) with id $ALLOC
|
= note: BACKTRACE:
- = note: inside `miri_start` at tests/pass/alloc-access-tracking.rs:LL:CC
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:LL:CC
|
-LL | *ptr = 42; // Crucially, only a write is printed here, no read!
+LL | assert_eq!(*ptr, 42);
- | ^^^^^^^^^ write access to allocation with id $ALLOC
+ | ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id $ALLOC
|
= note: BACKTRACE:
- = note: inside `miri_start` at tests/pass/alloc-access-tracking.rs:LL:CC
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:LL:CC
|
LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
| ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id $ALLOC
|
... 5 lines skipped ...
--> tests/pass/alloc-access-tracking.rs:LL:CC
|
-LL | miri_dealloc(ptr, 123, 1);
+LL | assert_eq!(*ptr, 42);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ freed allocation with id $ALLOC
+ | ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id $ALLOC
|
= note: BACKTRACE:
- = note: inside `miri_start` at tests/pass/alloc-access-tracking.rs:LL:CC
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ freed allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
---
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
---
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
| ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
---
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
---
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
| ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
---
Location:
/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.29.2/src/lib.rs:369
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`
Caused by:
process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps/ui-5a4f22761d8182b7` (exit status: 1)
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:03:54
local time: Mon May 19 20:34:13 UTC 2025
network time: Mon, 19 May 2025 20:34:14 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
tests/pass/float_nan.rs ... ok
tests/pass/0weak_memory_consistency_sc.rs ... ok
FAILED TEST: tests/pass/alloc-access-tracking.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-S75He8" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/pass" "tests/pass/alloc-access-tracking.rs" "-Zmiri-track-alloc-id=21" "-Zmiri-track-alloc-accesses" "-Cpanic=abort" "--edition" "2021"
error: actual output differed from expected
Execute `./miri test --bless` to update `tests/pass/alloc-access-tracking.stderr` to the actual output
--- tests/pass/alloc-access-tracking.stderr
+++ <stderr output>
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:LL:CC
|
-LL | let ptr = miri_alloc(123, 1);
+LL | assert_eq!(*ptr, 42);
- | ^^^^^^^^^^^^^^^^^^ created Miri bare-metal heap allocation of 123 bytes (alignment ALIGN bytes) with id $ALLOC
+ | ^^^^^^^^^^^^^^^^^^^^ created stack variable allocation of 16 bytes (alignment ALIGN bytes) with id $ALLOC
|
= note: BACKTRACE:
- = note: inside `miri_start` at tests/pass/alloc-access-tracking.rs:LL:CC
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:LL:CC
|
-LL | *ptr = 42; // Crucially, only a write is printed here, no read!
+LL | assert_eq!(*ptr, 42);
- | ^^^^^^^^^ write access to allocation with id $ALLOC
+ | ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id $ALLOC
|
= note: BACKTRACE:
- = note: inside `miri_start` at tests/pass/alloc-access-tracking.rs:LL:CC
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:LL:CC
|
LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
| ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id $ALLOC
|
... 5 lines skipped ...
--> tests/pass/alloc-access-tracking.rs:LL:CC
|
-LL | miri_dealloc(ptr, 123, 1);
+LL | assert_eq!(*ptr, 42);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ freed allocation with id $ALLOC
+ | ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id $ALLOC
|
= note: BACKTRACE:
- = note: inside `miri_start` at tests/pass/alloc-access-tracking.rs:LL:CC
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: tracking was triggered
+ --> tests/pass/alloc-access-tracking.rs:LL:CC
+ |
+LL | assert_eq!(*ptr, 42);
+ | ^^^^^^^^^^^^^^^^^^^^ freed allocation with id $ALLOC
+ |
+ = note: BACKTRACE:
+ = note: inside `miri_start` at RUSTLIB/core/src/macros/mod.rs:LL:CC
+ = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
---
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
---
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
| ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
---
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
---
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
| ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
| ^^^^^^^^^^^^^^^^^^^^ write access to allocation with id 21
|
= note: BACKTRACE:
= note: inside `miri_start` at /checkout/library/core/src/macros/mod.rs:44:15: 44:32
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: tracking was triggered
--> tests/pass/alloc-access-tracking.rs:17:9
|
LL | assert_eq!(*ptr, 42);
---
Location:
/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.29.2/src/lib.rs:369
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`
Caused by:
process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps/ui-5a4f22761d8182b7` (exit status: 1)
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:03:53
local time: Tue May 20 00:28:57 UTC 2025
network time: Tue, 20 May 2025 00:28:57 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
The alloc-access-tracking.rs test in Miri is sensitive to the exact allocation counts; ID 21 mentioned in that test will have to be adjusted because there's now fewer extern statics being declared (the new ID is probably 20).
The job x86_64-gnu-llvm-19 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#18 exporting to docker image format
#18 sending tarball 20.2s done
#18 DONE 33.6s
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-19]
[CI_JOB_NAME=x86_64-gnu-llvm-19]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-19', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--set', 'gcc.download-ci-gcc=true', '--enable-new-symbol-mangling']
configure: build.build := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-19/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
[RUSTC-TIMING] proc_macro test:false 5.521
[RUSTC-TIMING] test test:false 9.485
Finished `release` profile [optimized] target(s) in 1m 19s
##[endgroup]
[TIMING] core::build_steps::compile::Std { target: x86_64-unknown-linux-gnu, compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: true }, crates: [], force_recompile: false, extra_rust_args: ["-Csymbol-mangling-version=v0", "-Cpanic=abort"], is_for_mir_opt_tests: false } -- 79.535
Testing GCC stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Downloading crates ...
Downloaded boml v0.3.1
Compiling boml v0.3.1
[RUSTC-TIMING] boml test:false 0.772
Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
[RUSTC-TIMING] y test:false 2.875
Finished `release` profile [optimized] target(s) in 3.96s
Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-backend gcc --gcc-path /checkout/obj/build/x86_64-unknown-linux-gnu/ci-gcc/lib --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --mini-tests --std-tests`
`--gcc-path` was provided, ignoring config file. Using `/checkout/obj/build/x86_64-unknown-linux-gnu/ci-gcc/lib` as path for libgccjit
[BUILD] mini_core
[RUSTC-TIMING] mini_core test:false 0.206
[BUILD] example
[AOT] mini_core_hello_world
[RUSTC-TIMING] mini_core_hello_world test:false 0.179
---
---- [run-make] tests/run-make/no-alloc-shim stdout ----
error: run-make test failed: could not build `rmake.rs` recipe
status: exit status: 1
command: RUSTC_BOOTSTRAP="-1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/no-alloc-shim/rmake" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/release/deps" "--extern" "run_make_support=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/librun_make_support.rlib" "--edition=2021" "/checkout/tests/run-make/no-alloc-shim/rmake.rs" "-Cprefer-dynamic" "-Dunused_must_use"
stdout: none
--- stderr -------------------------------
error[E0283]: type annotations needed for `Vec<_>`
##[error] --> /checkout/tests/run-make/no-alloc-shim/rmake.rs:28:9
|
28 | let mut platform_args = vec![];
| ^^^^^^^^^^^^^^^^^
...
41 | .args(&platform_args)
| ---- type must be known at this point
|
= note: multiple `impl`s satisfying `_: AsRef<OsStr>` found in the `std` crate:
- impl AsRef<OsStr> for OsStr;
- impl AsRef<OsStr> for OsString;
- impl AsRef<OsStr> for Path;
- impl AsRef<OsStr> for PathBuf;
- impl AsRef<OsStr> for std::string::String;
- impl AsRef<OsStr> for str;
note: required by a bound in `Cc::args`
--> /checkout/src/tools/run-make-support/src/external_deps/c_cxx_compiler/cc.rs:30:1
|
30 | crate::macros::impl_common_helpers!(Cc);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| required by a bound in this associated function
| required by this bound in `Cc::args`
= note: this error originates in the macro `crate::macros::impl_common_helpers` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider giving `platform_args` an explicit type, where the type for type parameter `S` is specified
|
28 | let mut platform_args: Vec<_> = vec![];
| ++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0283`.
cc @ojeda this will require RfL changes when it lands.
@bjorn3 Thanks for the ping! Currently we only use core, not alloc (and in the LTSs where we still use alloc, we only support a single Rust version) -- would we still need a change?
Right, forgot about that. In that case you shouldn't need to change anything.
Good news, then -- thanks for confirming!
Ping... this is blocking me from fixing Arm64EC again. Can someone please review the PR?
The job mingw-check-2 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Checking miri v0.1.0 (/checkout/src/tools/miri)
error[E0433]: failed to resolve: use of undeclared type `Conv`
--> src/tools/miri/src/shims/foreign_items.rs:616:47
|
616 | let [] = this.check_shim(abi, Conv::Rust, link_name, args)?;
| ^^^^ use of undeclared type `Conv`
For more information about this error, try `rustc --explain E0433`.
[RUSTC-TIMING] miri test:false 3.536
error: could not compile `miri` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
@bors r+
:pushpin: Commit 163d29a000864107e05874796c862d97912a2ce2 has been approved by bjorn3
It is now in the queue for this repository.
@bors r-
@bors r+
:pushpin: Commit cbdbd81158efa5821b77f0a53d5fc370f6b321bb has been approved by bjorn3
It is now in the queue for this repository.
@bors r- failed in https://github.com/rust-lang/rust/pull/142283
@bjorn3 could you please help me understand how this test was passing before?
It's a linker failure in the tests/ui/sanitizer/dataflow.rs test.
= note: /usr/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/sanitizer/dataflow/a.dataflow.a934cfd234e75439-cgu.0.rcgu.o: in function `_ZN8dataflow4main17h053d7a3d932e2846E.dfsan':
dataflow.a934cfd234e75439-cgu.0:(.text._ZN8dataflow4main17h053d7a3d932e2846E.dfsan+0x161): undefined reference to `_RNvCsi58mtoTmQEJ_7___rustc35___rust_no_alloc_shim_is_unstable_v2.dfsan'
collect2: error: ld returned 1 exit status
Was the load previously being optimized out? Seems like some of the other tests would have caught that...
Oh, interesting, the symbol has a .dfsan suffix... so is this a name mangling issue? Or are we supposed to be generating a different symbol name for this case?