Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #127409 - gurry:127332-ice-with-expr-not-struct, r=ol…
…i-obk Emit a wrap expr span_bug only if context is not tainted Fixes #127332 The ICE occurs because of this `span_bug`: https:/rust-lang/rust/blob/51917e2e69702e5752bce6a4f3bfd285d0f4ae39/compiler/rustc_hir_typeck/src/expr_use_visitor.rs#L732-L738 which is triggered by the fact that we're trying to use an `enum` in a `with` expression instead of a `struct`. The issue originates in commit 814bfe9 from PR #127202. As per the title of that commit the ICEing code should not be reachable any more, but looks like it still is. This PR changes the code so that the `span_bug` will be emitted only if the context is not tainted by a previous error.
- Loading branch information