Skip to content

codegen Propagate reported errors from ABI checks - #163713

Open
Dnreikronos wants to merge 2 commits into
rust-lang:mainfrom
Dnreikronos:codegen/propagate_reported_abi_errors
Open

Dnreikronos wants to merge 2 commits into
rust-lang:mainfrom
Dnreikronos:codegen/propagate_reported_abi_errors

Conversation

@Dnreikronos

@Dnreikronos Dnreikronos commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #162814

The oversized array already gets an E0080 error. Normalization keeps the failed constant as an error marker in the buffer's type, though, and computing the constructor's return layout gives ReferencesError. The shared ABI handler then hits span_bug!, so we get an ICE on top of the useful error.

Handle ReferencesError by returning its existing ErrorGuaranteed. The ABI checks can then return through their usual error path, and mono collection stops before codegen. I think the shared handler is the right place for this because it already decides how to report ABI failures. Const-eval handles this variant by keeping the reported error too.

I reduced the async example to a small buffer constructor with no external crates. The test uses build-fail so it reaches the ABI checks, with default and optimized revisions to cover both paths.

Rebuilt the compiler and ran both new revisions plus the existing oversized-layout test. All three passed. Compiler checks and formatting passed too. Clippy completed with existing warnings allowed.

@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 3, 2026
@rustbot

rustbot commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

r? @Enselic

rustbot has assigned @Enselic.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 19 candidates

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
extracting /checkout/obj/build/cache/2026-09-29/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/rustfmt
[TIMING:end] format::InternalRustfmt {  } -- 12.755
fmt: checked 7338 files
tidy check
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/const-generics/gca/issue-162814.rs` to `{reason}-issue-162814.rs`
tidy [ui_tests (tests)]: FAIL
tidy [rustdoc_json (src)]: `rustdoc-json-types` modified, checking format version
tidy: Skipping binary file check, read-only filesystem
removing old virtual environment
creating virtual environment at '/checkout/obj/build/venv' using 'python3.12' and 'venv'
Requirement already satisfied: pip in ./build/venv/lib/python3.12/site-packages (24.0)
---
Running eslint on rustdoc JS files
info: ES-Check: checking 7 files...
info: ✓ ES-Check passed! All files are ES10 compatible.
typechecking javascript files
tidy: The following check failed: ui_tests (tests)
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/rust-tidy --root-path=/checkout --cargo-path=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo --output-dir=/checkout/obj/build --concurrency=4 --npm-path=/node/bin/yarn --ci=true --extra-checks=py,cpp,js,spellcheck` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1627:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:1747:29

Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Currently active steps:
test::Tidy {  } at src/bootstrap/src/core/build_steps/test.rs:1665
Build completed unsuccessfully in 0:02:37
  local time: Sat Oct  3 18:07:17 UTC 2026

This branch has not been deployed

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

Labels

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.

[ICE]: generic_const_args with async and closure

4 participants