-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix ICE in eval_body_using_ecx
#123491
Fix ICE in eval_body_using_ecx
#123491
Conversation
r? @oli-obk (?) |
f718480
to
71c64ed
Compare
This comment has been minimized.
This comment has been minimized.
71c64ed
to
f4ad462
Compare
compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
f4ad462
to
2783775
Compare
This comment has been minimized.
This comment has been minimized.
5ebc975
to
89e74af
Compare
compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
89e74af
to
4ee780a
Compare
@bors r+ rollup |
…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
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 See #123966 (comment). @bors r- |
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
4ee780a
to
c30e15a
Compare
@bors r+ rollup |
…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
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
…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`.
…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`.
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`.
Ensures
TypeckResults
is tainted by failing candidate assembly for types with errorFixes #123154