mirror of
https://github.com/rust-lang/rust.git
synced 2025-12-29 22:14:44 +00:00
RFC2229: Use the correct place type Closes https://github.com/rust-lang/rust/issues/87097 The ICE occurred because instead of looking at the type of the place after all the projections are applied, we instead looked at the `base_ty` of the Place to decide whether a discriminant should be read of not. This lead to two issues: 1. the kind of the type is not necessarily `Adt` since we only look at the `base_ty`, it could be instead `Ref` for example 2. if the kind of the type is `Adt` you could still be looking at the wrong variant to make a decision on whether the discriminant should be read or not r? `@nikomatsakis`
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.