Skip to content

Detect struct construction with private field in field with default #135846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Jan 21, 2025

When trying to construct a struct that has a public field of a private type, suggest using .. if that field has a default value.

error[E0603]: struct `Priv1` is private
  --> $DIR/non-exhaustive-ctor-2.rs:19:39
   |
LL |     let _ = S { field: (), field1: m::Priv1 {} };
   |                            ------     ^^^^^ private struct
   |                            |
   |                            while setting this field
   |
note: the struct `Priv1` is defined here
  --> $DIR/non-exhaustive-ctor-2.rs:14:4
   |
LL |    struct Priv1 {}
   |    ^^^^^^^^^^^^
help: the type `Priv1` of field `field1` is private, but you can construct the default value defined for it in `S` using `..` in the struct initializer expression
   |
LL |     let _ = S { field: (), .. };
   |                            ~~

@rustbot
Copy link
Collaborator

rustbot commented Jan 21, 2025

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 21, 2025
@estebank estebank added F-default_field_values `#![feature(default_field_values)]` and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 21, 2025
@estebank estebank added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 21, 2025
@estebank estebank added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. A-diagnostics Area: Messages for errors, warnings, and lints labels Jan 22, 2025
@estebank estebank force-pushed the non-exhaustive-dfv-ctor-2 branch 2 times, most recently from 5f24487 to 7e07e4f Compare January 23, 2025 05:35
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preliminary review.

@@ -1022,6 +1023,7 @@ pub struct Resolver<'ra, 'tcx> {

/// N.B., this is used only for better diagnostics, not name resolution itself.
field_names: LocalDefIdMap<Vec<Ident>>,
field_defaults: LocalDefIdMap<Vec<Symbol>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Symbol instead Ident raises a few warning flags in my head because I'm pretty sure that this means anything involving field_defaults doesn't handle macro hygiene correctly. This is only relevant to decl macros 2.0 (feature decl_macro).

It might be a non-issue, I haven't thought that hard yet. I'll need to read the rest of this PR first.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worst case it's just wrong diagnostics in macro edge cases

@fmease
Copy link
Member

fmease commented Jan 25, 2025

Checking perf due to additional query feeding in the happy path (if I saw that correctly).

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 25, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 25, 2025
…r=<try>

Detect struct construction with private field in field with default

When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.

```
error[E0603]: struct `Priv1` is private
  --> $DIR/non-exhaustive-ctor.rs:25:39
   |
LL |     let _ = S { field: (), field1: m::Priv1 {} };
   |                            ------     ^^^^^ private struct
   |                            |
   |                            while setting this field
   |
note: the struct `Priv1` is defined here
  --> $DIR/non-exhaustive-ctor.rs:14:4
   |
LL |    struct Priv1 {}
   |    ^^^^^^^^^^^^
help: the field `field1` you're trying to set has a default value, you can use `..` to use it
   |
LL |     let _ = S { field: (), .. };
   |                            ~~
```
@bors

This comment was marked as resolved.

@rust-timer

This comment has been minimized.

@bors

This comment was marked as outdated.

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5e87c8e): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.8% [0.8%, 0.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.2%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.1%, secondary -0.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.1% [0.8%, 3.4%] 2
Regressions ❌
(secondary)
1.2% [1.2%, 1.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-0.6%, -0.6%] 3
All ❌✅ (primary) 2.1% [0.8%, 3.4%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 770.579s -> 772.7s (0.28%)
Artifact size: 325.79 MiB -> 325.79 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 25, 2025
@estebank estebank force-pushed the non-exhaustive-dfv-ctor-2 branch from 7e07e4f to 38f8f98 Compare January 28, 2025 07:35
@estebank estebank force-pushed the non-exhaustive-dfv-ctor-2 branch from 38f8f98 to 7d576f6 Compare February 12, 2025 00:18
@bors
Copy link
Collaborator

bors commented Mar 11, 2025

☔ The latest upstream changes (presumably #128440) made this pull request unmergeable. Please resolve the merge conflicts.

@wesleywiser
Copy link
Member

wesleywiser commented Apr 17, 2025

Hi @fmease, I think this is just waiting on some feedback from you whether this is an issue or not and then a rebase from the author since perf looks neutral. Thanks!

@BoxyUwU BoxyUwU added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 10, 2025
@estebank estebank force-pushed the non-exhaustive-dfv-ctor-2 branch 2 times, most recently from d3a309b to 9bcda61 Compare June 27, 2025 22:40
@estebank estebank added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 3, 2025
@bors
Copy link
Collaborator

bors commented Jul 11, 2025

☔ The latest upstream changes (presumably #143762) made this pull request unmergeable. Please resolve the merge conflicts.

estebank added 2 commits July 18, 2025 16:39
When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.

```
error[E0603]: struct `Priv1` is private
  --> $DIR/non-exhaustive-ctor.rs:25:39
   |
LL |     let _ = S { field: (), field1: m::Priv1 {} };
   |                            ------     ^^^^^ private struct
   |                            |
   |                            while setting this field
   |
note: the struct `Priv1` is defined here
  --> $DIR/non-exhaustive-ctor.rs:14:4
   |
LL |    struct Priv1 {}
   |    ^^^^^^^^^^^^
help: the field `field1` you're trying to set has a default value, you can use `..` to use it
   |
LL |     let _ = S { field: (), .. };
   |                            ~~
```
@estebank estebank force-pushed the non-exhaustive-dfv-ctor-2 branch from 9bcda61 to c41fee3 Compare July 18, 2025 16:39
@BoxyUwU
Copy link
Member

BoxyUwU commented Jul 24, 2025

@bors r+ rollup=iffy not sure if there will be perf impact from the pathsource stuff

@bors
Copy link
Collaborator

bors commented Jul 24, 2025

📌 Commit c41fee3 has been approved by BoxyUwU

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 24, 2025
@bors
Copy link
Collaborator

bors commented Jul 25, 2025

⌛ Testing commit c41fee3 with merge b918c7c...

bors added a commit that referenced this pull request Jul 25, 2025
Detect struct construction with private field in field with default

When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.

```
error[E0603]: struct `Priv1` is private
  --> $DIR/non-exhaustive-ctor-2.rs:19:39
   |
LL |     let _ = S { field: (), field1: m::Priv1 {} };
   |                            ------     ^^^^^ private struct
   |                            |
   |                            while setting this field
   |
note: the struct `Priv1` is defined here
  --> $DIR/non-exhaustive-ctor-2.rs:14:4
   |
LL |    struct Priv1 {}
   |    ^^^^^^^^^^^^
help: the type `Priv1` of field `field1` is private, but you can construct the default value defined for it in `S` using `..` in the struct initializer expression
   |
LL |     let _ = S { field: (), .. };
   |                            ~~
```
@matthiaskrgr
Copy link
Member

@bors retry r-

looks like ci never started in the past 5 hours? 🤔

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 25, 2025
@matthiaskrgr
Copy link
Member

@bors r=BoxyUwU rollup=iffy

@bors
Copy link
Collaborator

bors commented Jul 25, 2025

📌 Commit c41fee3 has been approved by BoxyUwU

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 25, 2025
bors added a commit that referenced this pull request Jul 25, 2025
Detect struct construction with private field in field with default

When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.

```
error[E0603]: struct `Priv1` is private
  --> $DIR/non-exhaustive-ctor-2.rs:19:39
   |
LL |     let _ = S { field: (), field1: m::Priv1 {} };
   |                            ------     ^^^^^ private struct
   |                            |
   |                            while setting this field
   |
note: the struct `Priv1` is defined here
  --> $DIR/non-exhaustive-ctor-2.rs:14:4
   |
LL |    struct Priv1 {}
   |    ^^^^^^^^^^^^
help: the type `Priv1` of field `field1` is private, but you can construct the default value defined for it in `S` using `..` in the struct initializer expression
   |
LL |     let _ = S { field: (), .. };
   |                            ~~
```
@bors
Copy link
Collaborator

bors commented Jul 25, 2025

⌛ Testing commit c41fee3 with merge 21c50ce...

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-msvc-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- [debuginfo-cdb] tests\debuginfo\lexical-scope-in-if-let.rs stdout ----

error: check directive(s) from `C:\a\rust\rust\tests\debuginfo\lexical-scope-in-if-let.rs` not found in debugger output. errors:
    (lexical-scope-in-if-let.rs:71) `[...]a = 0n123`
    (lexical-scope-in-if-let.rs:72) `[...]b = 0n456`
    (lexical-scope-in-if-let.rs:73) `[...]c = 0n789`
    (lexical-scope-in-if-let.rs:74) `[...]x = 0n42`
    (lexical-scope-in-if-let.rs:76) `[...]z = 0n10`
the following subset of check directive(s) was found successfully:
    (lexical-scope-in-if-let.rs:55) `              a = 0n123`
    (lexical-scope-in-if-let.rs:59) `              a = 0n123`
    (lexical-scope-in-if-let.rs:60) `              x = 0n42`
    (lexical-scope-in-if-let.rs:64) `              a = 0n123`
    (lexical-scope-in-if-let.rs:65) `              b = 0n456`
    (lexical-scope-in-if-let.rs:66) `              x = 0n42`
    (lexical-scope-in-if-let.rs:67) `              y = true`
    (lexical-scope-in-if-let.rs:75) `              y = true`
status: exit code: 0
command: PATH="C:\a\rust\rust\build\aarch64-pc-windows-msvc\stage2\lib\rustlib\aarch64-pc-windows-msvc\lib;C:\Program Files (x86)\Windows Kits\10\bin\arm64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\arm64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostARM64\arm64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostARM64\arm64;C:\a\rust\rust\build\aarch64-pc-windows-msvc\bootstrap-tools\aarch64-pc-windows-msvc\release\deps;C:\Program Files\Git\clangarm64\bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;C:\a\rust\rust\ninja;C:\a\rust\rust\citools\clang-rust\bin;C:\a\rust\rust\sccache;C:\Users\runneradmin\.cargo\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.3.1\x64;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files (x86)\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.21.13\arm64\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.442-6\x64\bin;C:\Program Files (x86)\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\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\dotnet;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\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\clangarm64\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\AppData\Local\Microsoft\WindowsApps" "C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\arm64\\cdb.exe" "-lines" "-cf" "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\test\\debuginfo\\lexical-scope-in-if-let.cdb\\lexical-scope-in-if-let.debugger.script" "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\test\\debuginfo\\lexical-scope-in-if-let.cdb\\a.exe"
--- stdout -------------------------------

************* Preparing the environment for Debugger Extensions Gallery repositories **************
   ExtensionRepository : Implicit
   UseExperimentalFeatureForNugetShare : true
   AllowNugetExeUpdate : true
   NonInteractiveNuget : true
   AllowNugetMSCredentialProviderInstall : true
   AllowParallelInitializationOfLocalRepositories : true

   EnableRedirectToV8JsProvider : false

   -- Configuring repositories
      ----> Repository : LocalInstalled, Enabled: true
      ----> Repository : UserExtensions, Enabled: true

>>>>>>>>>>>>> Preparing the environment for Debugger Extensions Gallery repositories completed, duration 0.000 seconds

************* Waiting for Debugger Extensions Gallery to Initialize **************

>>>>>>>>>>>>> Waiting for Debugger Extensions Gallery to Initialize completed, duration 0.032 seconds
   ----> Repository : UserExtensions, Enabled: true, Packages count: 0
   ----> Repository : LocalInstalled, Enabled: true, Packages count: 27

Microsoft (R) Windows Debugger Version 10.0.26100.1 ARM64
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: C:\a\rust\rust\build\aarch64-pc-windows-msvc\test\debuginfo\lexical-scope-in-if-let.cdb\a.exe

************* Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*
Symbol search path is: srv*
Executable search path is: 
ModLoad: 00007ff7`08e60000 00007ff7`08e66000   a.exe   
ModLoad: 00007ffe`90940000 00007ffe`90d45000   ntdll.dll
ModLoad: 00007ffe`8de80000 00007ffe`8dfe4000   C:\Windows\System32\KERNEL32.DLL
ModLoad: 00007ffe`8c5c0000 00007ffe`8cc4a000   C:\Windows\System32\KERNELBASE.dll
ModLoad: 00007ffe`8bfc0000 00007ffe`8c1b3000   C:\Windows\System32\ucrtbase.dll
ModLoad: 00007ffe`5e880000 00007ffe`5f250000   C:\a\rust\rust\build\aarch64-pc-windows-msvc\stage2\lib\rustlib\aarch64-pc-windows-msvc\lib\std-b134c8f7bce8c4d3.dll
ModLoad: 00007ffe`8d260000 00007ffe`8d324000   C:\Windows\System32\WS2_32.dll
ModLoad: 00007ffe`8e230000 00007ffe`8e44f000   C:\Windows\System32\RPCRT4.dll
ModLoad: 00007ffe`8c1c0000 00007ffe`8c289000   C:\Windows\System32\bcryptprimitives.dll
ModLoad: 00007ffe`730c0000 00007ffe`730f5000   C:\Windows\SYSTEM32\VCRUNTIME140.dll
ModLoad: 00007ffe`8a7d0000 00007ffe`8a81e000   C:\Windows\SYSTEM32\USERENV.dll
(2450.1bd8): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
00007ffe`90a4a790 d43e0000 brk         #0xF000
0:000> version
Windows 10 Version 22631 MP (4 procs) Free ARM 64-bit (AArch64)
Product: WinNt, suite: SingleUserTS
Edition build lab: 22621.1.arm64fre.ni_release.220506-1250
Build layer: DesktopEditions -> 22621.1.arm64fre.ni_release.220506-1250
Build layer: ShellCommon -> 22621.4890.arm64fre.ni_release_svc_prod1.250131-1737
Build layer: OSClient   -> 22621.4890.arm64fre.ni_release_svc_prod1.250131-1737
Debug session time: Fri Jul 25 15:21:45.333 2025 (UTC + 0:00)
System Uptime: 0 days 1:29:49.042
Process Uptime: 0 days 0:00:00.071
  Kernel time: 0 days 0:00:00.000
  User time: 0 days 0:00:00.000
Live user mode: <Local>

Microsoft (R) Windows Debugger Version 10.0.26100.1 ARM64
Copyright (c) Microsoft Corporation. All rights reserved.

command line: '"C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\cdb.exe" -lines -cf C:\a\rust\rust\build\aarch64-pc-windows-msvc\test\debuginfo\lexical-scope-in-if-let.cdb\lexical-scope-in-if-let.debugger.script C:\a\rust\rust\build\aarch64-pc-windows-msvc\test\debuginfo\lexical-scope-in-if-let.cdb\a.exe'  Debugger Process 0x18D4 
dbgeng:  image 10.0.26100.1, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\dbgeng.dll]
dbghelp: image 10.0.26100.1, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\dbghelp.dll]
        DIA version: 33136
Extension DLL search Path:
    C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\WINXP;C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\winext;C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\winext\arcade;C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\pri;C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64;C:\Users\runneradmin\AppData\Local\Dbg\EngineExtensions;C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64;C:\a\rust\rust\build\aarch64-pc-windows-msvc\stage2\lib\rustlib\aarch64-pc-windows-msvc\lib;C:\Program Files (x86)\Windows Kits\10\bin\arm64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\arm64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostARM64\arm64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostARM64\arm64;C:\a\rust\rust\build\aarch64-pc-windows-msvc\bootstrap-tools\aarch64-pc-windows-msvc\release\deps;C:\Program Files\Git\clangarm64\bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;C:\a\rust\rust\ninja;C:\a\rust\rust\citools\clang-rust\bin;C:\a\rust\rust\sccache;C:\Users\runneradmin\.cargo\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.3.1\x64;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files (x86)\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.21.13\arm64\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.442-6\x64\bin;C:\Program Files (x86)\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\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\dotnet;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\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\clangarm64\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\AppData\Local\Microsoft\WindowsApps
Extension DLL chain:
    dbghelp: image 10.0.26100.1, API 10.0.6, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\dbghelp.dll]
    exts: image 10.0.26100.1, API 1.0.0, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\WINXP\exts.dll]
    uext: image 10.0.26100.1, API 1.0.0, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\winext\uext.dll]
    ntsdexts: image 10.0.26100.1, API 1.0.0, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\WINXP\ntsdexts.dll]
0:000> .nvlist
Loaded NatVis Files:
    <None Loaded>
0:000> bp `lexical-scope-in-if-let.rs:81`
*** WARNING: Unable to verify checksum for a.exe
0:000> bp `lexical-scope-in-if-let.rs:84`
0:000> bp `lexical-scope-in-if-let.rs:89`
0:000> bp `lexical-scope-in-if-let.rs:94`
0:000>  g
Breakpoint 0 hit
a!lexical_scope_in_if_let::main+0x18:
00007ff7`08e61168 94000041 bl          a!lexical_scope_in_if_let::zzz (00007ff7`08e6126c)
0:000>  dv /n
              a = 0n123
              b = <value unavailable>
              x = <value unavailable>
              y = <value unavailable>
0:000>  g
Breakpoint 1 hit
a!lexical_scope_in_if_let::main+0x4c:
00007ff7`08e6119c 94000034 bl          a!lexical_scope_in_if_let::zzz (00007ff7`08e6126c)
0:000>  dv /n
              a = 0n123
              b = <value unavailable>
              x = 0n42
              y = <value unavailable>
0:000>  g
Breakpoint 1 hit
a!lexical_scope_in_if_let::main+0x4c:
00007ff7`08e6119c 94000034 bl          a!lexical_scope_in_if_let::zzz (00007ff7`08e6126c)
0:000>  dv /n
              a = 0n123
              b = <value unavailable>
              x = 0n42
              y = <value unavailable>
0:000>  g
Breakpoint 2 hit
a!lexical_scope_in_if_let::main+0x98:
00007ff7`08e611e8 94000021 bl          a!lexical_scope_in_if_let::zzz (00007ff7`08e6126c)
0:000>  dv /n
              a = 0n123
              b = 0n456
              x = 0n42
              y = true
0:000> qq
quit:
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\atlmfc.natvis'
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\ObjectiveC.natvis'
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\concurrency.natvis'
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\cpp_rest.natvis'
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\stl.natvis'
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\Windows.Data.Json.natvis'
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\Windows.Devices.Geolocation.natvis'
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\Windows.Devices.Sensors.natvis'
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\Windows.Media.natvis'
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\windows.natvis'
NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\Visualizers\winrt.natvis'
------------------------------------------
stderr: none



failures:
    [debuginfo-cdb] tests\debuginfo\lexical-scope-in-if-let.rs

test result: FAILED. 155 passed; 1 failed; 11 ignored; 0 measured; 0 filtered out; finished in 30.07s

Some tests failed in compiletest suite=debuginfo mode=debuginfo host=aarch64-pc-windows-msvc target=aarch64-pc-windows-msvc
Build completed unsuccessfully in 1:13:32
make: *** [Makefile:112: ci-msvc-py] Error 1
  local time: Fri Jul 25 15:21:59 CUT 2025
  network time: Fri, 25 Jul 2025 15:22:00 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version

@bors
Copy link
Collaborator

bors commented Jul 25, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 25, 2025
@estebank
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints F-default_field_values `#![feature(default_field_values)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants