You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// For consistency with `write_discriminant`, and to make sure that `project_downcast` cannot fail due to strange layouts, we declare immediate UB for uninhabited variants.
251
+
// Reading the discriminant of an uninhabited variant is UB. This is the basis for the
252
+
// `uninhabited_enum_branching` MIR pass. It also ensures consistency with
253
+
// `write_discriminant`, and makes sure that `project_downcast` cannot fail due to strange
254
+
// layouts.
248
255
if op.layout().for_variant(self, index).abi.is_uninhabited(){
0 commit comments