Skip to content

Allow monomorphization time const eval failures if the cause is a type layout issue #124516

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 23, 2024

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Apr 29, 2024

r? @RalfJung

fixes #124348

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 29, 2024
@rustbot
Copy link
Collaborator

rustbot commented Apr 29, 2024

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 29, 2024
@oli-obk oli-obk changed the title Allow const eval failures if the cause is a type layout issue Allow monomorphization time const eval failures if the cause is a type layout issue Apr 30, 2024
Copy link
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

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

r=me with the comment nit -- but I think this does not entirely solve the problem; I just don't have the time to try and find an example right now

err_inval!(Layout(LayoutError::ReferencesError(guar))) => {
ErrorHandled::Reported(guar.into(), span.unwrap_or(DUMMY_SP))
}
err_inval!(Layout(LayoutError::ReferencesError(guar))) => ErrorHandled::Reported(
Copy link
Member

Choose a reason for hiding this comment

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

What if there is aSizeOverflow in a promoted?

This PR seems like a good step so I am okay with landing it, but it seems to me there's still a potential for ICEs here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a test for promoteds. On master we got a bogus "erroneous constant" note. Now it's gone.

Copy link
Member

Choose a reason for hiding this comment

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

I was specifically wondering about SizeOverflow as that's a different LayoutError variant that would bypass your new case here,

@oli-obk oli-obk force-pushed the taint_const_eval branch from b072cc3 to 4cf34cb Compare May 23, 2024 10:52
@oli-obk
Copy link
Contributor Author

oli-obk commented May 23, 2024

@bors r=RalfJung rollup

@bors
Copy link
Collaborator

bors commented May 23, 2024

📌 Commit 4cf34cb has been approved by RalfJung

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 May 23, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 23, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#124297 (Allow coercing functions whose signature differs in opaque types in their defining scope into a shared function pointer type)
 - rust-lang#124516 (Allow monomorphization time const eval failures if the cause is a type layout issue)
 - rust-lang#124976 (rustc: Use `tcx.used_crates(())` more)
 - rust-lang#125210 (Cleanup: Fix up some diagnostics)
 - rust-lang#125409 (Rename `FrameworkOnlyWindows` to `RawDylibOnlyWindows`)
 - rust-lang#125416 (Use correct param-env in `MissingCopyImplementations`)
 - rust-lang#125421 (Rewrite `core-no-oom-handling`, `issue-24445` and `issue-38237` `run-make` tests to new `rmake.rs` format)
 - rust-lang#125438 (Remove unneeded string conversion)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit eb6b35b into rust-lang:master May 23, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 23, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 23, 2024
Rollup merge of rust-lang#124516 - oli-obk:taint_const_eval, r=RalfJung

Allow monomorphization time const eval failures if the cause is a type layout issue

r? `@RalfJung`

fixes  rust-lang#124348
@saethlin saethlin mentioned this pull request Jul 10, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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: interpret const eval failure of Unevaluated(UnevaluatedConst ... which is not in required_consts
4 participants