Skip to content

Fix ICE in eval_body_using_ecx #123491

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 1 commit into from
Apr 16, 2024

Conversation

gurry
Copy link
Contributor

@gurry gurry commented Apr 5, 2024

Ensures TypeckResults is tainted by failing candidate assembly for types with error

Fixes #123154

@rustbot
Copy link
Collaborator

rustbot commented Apr 5, 2024

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
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 Apr 5, 2024
@BoxyUwU
Copy link
Member

BoxyUwU commented Apr 5, 2024

r? @oli-obk (?)

@rustbot rustbot assigned oli-obk and unassigned BoxyUwU Apr 5, 2024
@gurry gurry force-pushed the 123154-ice-unsized-struct-eval branch from f718480 to 71c64ed Compare April 13, 2024 06:07
@rust-log-analyzer

This comment has been minimized.

@gurry gurry force-pushed the 123154-ice-unsized-struct-eval branch from 71c64ed to f4ad462 Compare April 13, 2024 10:17
@rust-log-analyzer

This comment has been minimized.

@gurry gurry force-pushed the 123154-ice-unsized-struct-eval branch from f4ad462 to 2783775 Compare April 13, 2024 11:52
@rust-log-analyzer

This comment has been minimized.

@gurry gurry force-pushed the 123154-ice-unsized-struct-eval branch 2 times, most recently from 5ebc975 to 89e74af Compare April 15, 2024 04:58
@rust-log-analyzer

This comment has been minimized.

@gurry gurry force-pushed the 123154-ice-unsized-struct-eval branch from 89e74af to 4ee780a Compare April 15, 2024 07:52
@oli-obk
Copy link
Contributor

oli-obk commented Apr 15, 2024

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 15, 2024

📌 Commit 4ee780a has been approved by oli-obk

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 Apr 15, 2024
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Apr 15, 2024
…al, r=oli-obk

Fix ICE in `eval_body_using_ecx`

Ensures `TypeckResults` is tainted by failing candidate assembly for types with error

Fixes rust-lang#123154
@jieyouxu
Copy link
Member

jieyouxu commented Apr 15, 2024

Failed in rollup because the corresponding ICE test in the new crashes test suite https://github.com/rust-lang/rust/blob/84e729a59f216cc64755788a470f165429a731f4/tests/crashes/123154.rs is no longer ICEing (i.e. this PR fixed it). Please move this test from tests/crashes to tests/ui, or remove the test if a substitute test is available.

See #123966 (comment).

@bors r-

@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 Apr 15, 2024
@gurry
Copy link
Contributor Author

gurry commented Apr 16, 2024

Failed in rollup because the corresponding ICE test in the new crashes test suite https://github.com/rust-lang/rust/blob/84e729a59f216cc64755788a470f165429a731f4/tests/crashes/123154.rs is no longer ICEing (i.e. this PR fixed it). Please move this test from tests/crashes to tests/ui, or remove the test if a substitute test is available.

See #123966 (comment).

Thanks @jieyouxu

I have already added the exact same code as my test for this fix under tests/ui so I'll remove it from tests/crashes.

Can I just say that tracking all the ICEs within rustc is such a great idea!

Trait predicates for types which have errors may still
evaluate to OK leading to downstream ICEs. Now we return
a selection error for such types in candidate assembly and
thereby prevent such issues
@gurry gurry force-pushed the 123154-ice-unsized-struct-eval branch from 4ee780a to c30e15a Compare April 16, 2024 07:14
@oli-obk
Copy link
Contributor

oli-obk commented Apr 16, 2024

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 16, 2024

📌 Commit c30e15a has been approved by oli-obk

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

Rollup of 14 pull requests

Successful merges:

 - rust-lang#120781 (Correct usage note on OpenOptions::append())
 - rust-lang#121694 (sess: stabilize `-Zrelro-level` as `-Crelro-level`)
 - rust-lang#122521 (doc(bootstrap): add top-level doc-comment to utils/tarball.rs)
 - rust-lang#123491 (Fix ICE in `eval_body_using_ecx`)
 - rust-lang#123574 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 6))
 - rust-lang#123687 (Update ar_archive_writer to 0.2.0)
 - rust-lang#123721 (Various visionOS fixes)
 - rust-lang#123797 (Better graphviz output for SCCs and NLL constraints)
 - rust-lang#123990 (Make `suggest_deref_closure_return` more idiomatic/easier to understand)
 - rust-lang#123995 (Make `thir_tree` and `thir_flat` into hooks)
 - rust-lang#123998 (Opaque types have no namespace)
 - rust-lang#124001 (Fix docs for unstable_features lint.)
 - rust-lang#124006 (Move size assertions for `mir::syntax` types into the same file)
 - rust-lang#124011 (rustdoc: update the module-level docs of `rustdoc::clean`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ea7eb71 into rust-lang:master Apr 16, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 16, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 16, 2024
Rollup merge of rust-lang#123491 - gurry:123154-ice-unsized-struct-eval, r=oli-obk

Fix ICE in `eval_body_using_ecx`

Ensures `TypeckResults` is tainted by failing candidate assembly for types with error

Fixes rust-lang#123154
@gurry gurry deleted the 123154-ice-unsized-struct-eval branch April 17, 2024 06:06
jhpratt added a commit to jhpratt/rust that referenced this pull request May 14, 2024
…r=Nadrieril

Fix ICE while casting a type with error

Fixes rust-lang#124848

The ICE originates here: https://github.com/rust-lang/rust/blob/f9a3fd966162b3c7386d90fe4626471f66ba3b8f/compiler/rustc_hir_typeck/src/cast.rs#L143 The underlying cause is that a type with error, `MyType` was involved in a cast. During cast checks the below method `pointer_kind` was called: https://github.com/rust-lang/rust/blob/f9a3fd966162b3c7386d90fe4626471f66ba3b8f/compiler/rustc_hir_typeck/src/cast.rs#L87-L91 Thanks to the changes in PR rust-lang#123491, `type_is_sized_modulo_regions` in `pointer_kind` returned `false` which caused control to reach the `span_bug` here: https://github.com/rust-lang/rust/blob/f9a3fd966162b3c7386d90fe4626471f66ba3b8f/compiler/rustc_hir_typeck/src/cast.rs#L143 resulting in an ICE.

This PR fixes the issue by changing the `span_bug` to a `span_delayed_bug`.
jhpratt added a commit to jhpratt/rust that referenced this pull request May 14, 2024
…r=Nadrieril

Fix ICE while casting a type with error

Fixes rust-lang#124848

The ICE originates here: https://github.com/rust-lang/rust/blob/f9a3fd966162b3c7386d90fe4626471f66ba3b8f/compiler/rustc_hir_typeck/src/cast.rs#L143 The underlying cause is that a type with error, `MyType` was involved in a cast. During cast checks the below method `pointer_kind` was called: https://github.com/rust-lang/rust/blob/f9a3fd966162b3c7386d90fe4626471f66ba3b8f/compiler/rustc_hir_typeck/src/cast.rs#L87-L91 Thanks to the changes in PR rust-lang#123491, `type_is_sized_modulo_regions` in `pointer_kind` returned `false` which caused control to reach the `span_bug` here: https://github.com/rust-lang/rust/blob/f9a3fd966162b3c7386d90fe4626471f66ba3b8f/compiler/rustc_hir_typeck/src/cast.rs#L143 resulting in an ICE.

This PR fixes the issue by changing the `span_bug` to a `span_delayed_bug`.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 14, 2024
Rollup merge of rust-lang#124997 - gurry:124848-ice-should-be-sized, r=Nadrieril

Fix ICE while casting a type with error

Fixes rust-lang#124848

The ICE originates here: https://github.com/rust-lang/rust/blob/f9a3fd966162b3c7386d90fe4626471f66ba3b8f/compiler/rustc_hir_typeck/src/cast.rs#L143 The underlying cause is that a type with error, `MyType` was involved in a cast. During cast checks the below method `pointer_kind` was called: https://github.com/rust-lang/rust/blob/f9a3fd966162b3c7386d90fe4626471f66ba3b8f/compiler/rustc_hir_typeck/src/cast.rs#L87-L91 Thanks to the changes in PR rust-lang#123491, `type_is_sized_modulo_regions` in `pointer_kind` returned `false` which caused control to reach the `span_bug` here: https://github.com/rust-lang/rust/blob/f9a3fd966162b3c7386d90fe4626471f66ba3b8f/compiler/rustc_hir_typeck/src/cast.rs#L143 resulting in an ICE.

This PR fixes the issue by changing the `span_bug` to a `span_delayed_bug`.
# 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: assertion failed: layout.is_sized()
7 participants