Skip to content

Conversation

Kivooeo
Copy link
Member

@Kivooeo Kivooeo commented Oct 6, 2025

The same thing I did in #147416, actually the same bug but in another place, I'm not really sure how this method is good for fixing such ICEs, but, it does work and not conflicting with any existing tests, so I guess, it's fine

Fixes #147408

r? compiler

@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 Oct 6, 2025
@chenyukang
Copy link
Member

Thanks!
@bors r=chenyukang

@bors
Copy link
Collaborator

bors commented Oct 14, 2025

📌 Commit e1b361c has been approved by chenyukang

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 Oct 14, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 14, 2025
Add check if span is from macro expansion

The same thing I did in rust-lang#147416, actually the same bug but in another place, I'm not really sure how this method is good for fixing such ICEs, but, it does work and not conflicting with any existing tests, so I guess, it's fine

Fixes rust-lang#147408

r? compiler
bors added a commit that referenced this pull request Oct 14, 2025
Rollup of 7 pull requests

Successful merges:

 - #146187 (Unstably constify `ptr::drop_in_place` and related methods)
 - #146503 (std: improve handling of timed condition variable waits on macOS)
 - #147421 (Add check if span is from macro expansion)
 - #147630 (Bitset cleanups)
 - #147666 (Replace manual implementation with `carrying_mul_add`)
 - #147669 (fix missing link to `std::char` in `std` docs)
 - #147673 (pretty print u128 with display)

r? `@ghost`
`@rustbot` modify labels: rollup
jdonszelmann added a commit to jdonszelmann/rust that referenced this pull request Oct 14, 2025
Add check if span is from macro expansion

The same thing I did in rust-lang#147416, actually the same bug but in another place, I'm not really sure how this method is good for fixing such ICEs, but, it does work and not conflicting with any existing tests, so I guess, it's fine

Fixes rust-lang#147408

r? compiler
bors added a commit that referenced this pull request Oct 14, 2025
Rollup of 7 pull requests

Successful merges:

 - #146187 (Unstably constify `ptr::drop_in_place` and related methods)
 - #146503 (std: improve handling of timed condition variable waits on macOS)
 - #147421 (Add check if span is from macro expansion)
 - #147630 (Bitset cleanups)
 - #147666 (Replace manual implementation with `carrying_mul_add`)
 - #147669 (fix missing link to `std::char` in `std` docs)
 - #147673 (pretty print u128 with display)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr
Copy link
Member

@bors r-
#147684 (comment)

@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 Oct 14, 2025
@Kivooeo
Copy link
Member Author

Kivooeo commented Oct 14, 2025

Ngl I have no even close idea on why this could fail, like, is aarch64-pc-windows-msvc anyhow special from other targets? Or where specific I should take a look to understand reason of it

@Kivooeo
Copy link
Member Author

Kivooeo commented Oct 17, 2025

@chenyukang could you take a look at this comment above, it's very confusingggg

@chenyukang
Copy link
Member

I think this is caused by the diff in stderr:

-  WARN rustc_errors::emitter Invalid span $SRC_DIR/std/src/macros.rs:LL:COL (#11), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "$SRC_DIR/std/src/macros.rs" }) }
+  WARN rustc_errors::emitter Invalid span $SRC_DIR/std/src/macros.rs:LL:COL (#11), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/FAKE_PREFIX/library/std/src/macros.rs" }) }

seems there is a difference in Windows.

To ignore them, maybe you can have a try with https://rustc-dev-guide.rust-lang.org/tests/ui.html#normalization

then retry it with:

@bors try jobs=aarch64-msvc-1

@chenyukang
Copy link
Member

if that does not help, you may ask for help at:#t-compiler/help. 👉

@Kivooeo
Copy link
Member Author

Kivooeo commented Oct 18, 2025

I already asked in zulip even before this message https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/Windows.20path.20normalization.20in.20tests/with/545323081, but unfortunately no answers

Could you do bors try just to make sure this isn't one-time random bug

@chenyukang
Copy link
Member

@bors try jobs=aarch64-msvc-1

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 18, 2025
Add check if span is from macro expansion

try-job: aarch64-msvc-1
@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)
---- [ui] tests\ui\macros\macro-expansion-empty-span-147408.rs stdout ----
Saved the actual stderr to `C:\a\rust\rust\build\aarch64-pc-windows-msvc\test\ui\macros\macro-expansion-empty-span-147408\macro-expansion-empty-span-147408.stderr`
diff of stderr:

-  WARN rustc_errors::emitter Invalid span $SRC_DIR/std/src/macros.rs:LL:COL (#11), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "$SRC_DIR/std/src/macros.rs" }) }
+  WARN rustc_errors::emitter Invalid span $SRC_DIR/std/src/macros.rs:LL:COL (#11), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/FAKE_PREFIX/library/std/src/macros.rs" }) }
2 warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
3   --> $DIR/macro-expansion-empty-span-147408.rs:18:27
4    |

Note: some mismatched output was normalized before being compared
-  WARN rustc_errors::emitter Invalid span /rustc/FAKE_PREFIX\library\std\src\macros.rs:376:10: 376:10 (#11), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/FAKE_PREFIX\\library\\std\\src\\macros.rs" }) }
+  WARN rustc_errors::emitter Invalid span $SRC_DIR/std/src/macros.rs:LL:COL (#11), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/FAKE_PREFIX/library/std/src/macros.rs" }) }


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args macros\macro-expansion-empty-span-147408.rs`

error: 1 errors occurred comparing output.
status: exit code: 0
command: PATH="C:\a\rust\rust\build\aarch64-pc-windows-msvc\stage2\bin;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.44.35207\bin\HostARM64\arm64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\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:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.7.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.24.5\arm64\bin;C:\hostedtoolcache\windows\Python\3.12.10\arm64\Scripts;C:\hostedtoolcache\windows\Python\3.12.10\arm64;C:\hostedtoolcache\windows\Ruby\3.3.8\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\21.0.8-9.0\aarch64\bin;C:\Program Files (x86)\ImageMagick-7.1.2-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 (x86)\Windows Kits\10\Windows Performance Toolkit;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:\Tools\Ninja;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.11\bin;C:\Program Files\LLVM\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:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps" "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\stage2\\bin\\rustc.exe" "C:\\a\\rust\\rust\\tests\\ui\\macros\\macro-expansion-empty-span-147408.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=C:\\Users\\runneradmin\\.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=C:\\a\\rust\\rust\\vendor" "--sysroot" "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\stage2" "--target=aarch64-pc-windows-msvc" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\test\\ui\\macros\\macro-expansion-empty-span-147408" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\native\\rust-test-helpers"
stdout: none
--- stderr -------------------------------
 WARN rustc_errors::emitter Invalid span /rustc/FAKE_PREFIX\library\std\src\macros.rs:376:10: 376:10 (#11), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/FAKE_PREFIX\\library\\std\\src\\macros.rs" }) }
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
##[warning]  --> C:\a\rust\rust\tests\ui\macros\macro-expansion-empty-span-147408.rs:18:27
   |
LL |     for _ in dbg!([1, 2]).into_iter() {} //~ WARN this method call resolves to
   |                           ^^^^^^^^^
   |
   = warning: this changes meaning in Rust 2021
   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
   = note: `#[warn(array_into_iter)]` (part of `#[warn(rust_2021_compatibility)]`) on by default
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
   |
LL -     for _ in dbg!([1, 2]).into_iter() {} //~ WARN this method call resolves to
LL +     for _ in dbg!([1, 2]).iter() {} //~ WARN this method call resolves to
   |

warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021
##[warning]  --> C:\a\rust\rust\tests\ui\macros\macro-expansion-empty-span-147408.rs:9:16
   |
LL |             $e.into_iter() //~ WARN this method call resolves to
   |                ^^^^^^^^^
...
LL |     for _ in mac!(into_iter [1, 2]) {}
   |              ---------------------- in this macro invocation
   |
   = warning: this changes meaning in Rust 2021
   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html>
   = note: this warning originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
   |
LL -             $e.into_iter() //~ WARN this method call resolves to
LL +             $e.iter() //~ WARN this method call resolves to
   |
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
   |
LL |             IntoIterator::into_iter($e.into_iter()) //~ WARN this method call resolves to
   |             ++++++++++++++++++++++++              +

warning: for loop over an `Option`. This is more readably written as an `if let` statement
##[warning]  --> C:\a\rust\rust\tests\ui\macros\macro-expansion-empty-span-147408.rs:22:14
   |
LL |     for _ in mac!(next [1, 2]) {} //~ WARN for loop over an
   |              ^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(for_loops_over_fallibles)]` on by default
help: to iterate over `$e.iter()` remove the call to `next`
   |
LL -             $e.iter().next()
LL +             .by_ref().next()
   |
help: consider using `if let` to clear intent
   |
LL -     for _ in mac!(next [1, 2]) {} //~ WARN for loop over an
LL +     if let Some(_) = mac!(next [1, 2]) {} //~ WARN for loop over an
   |

warning: 3 warnings emitted
------------------------------------------

---

Some tests failed in compiletest suite=ui mode=ui host=aarch64-pc-windows-msvc target=aarch64-pc-windows-msvc
Bootstrap failed while executing `test --stage 2 --skip=compiler --skip=src`
Build completed unsuccessfully in 1:13:09
make: *** [Makefile:112: ci-msvc-py] Error 1
  local time: Sat Oct 18 06:03:47 CUT 2025
  network time: Sat, 18 Oct 2025 06:03:47 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

@rust-bors
Copy link

rust-bors bot commented Oct 18, 2025

💔 Test for 9e2138d failed: CI. Failed jobs:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

ICE array_into_iter span must not be empty and have no suggesion

7 participants