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
Disallow Unsized Enums
Fixes#16812.
This PR is a potential fix for #16812, an issue which is reported [again](#36801) and [again](#36975), with over a dozen duplicates by now.
This PR is mainly meant to promoted discussion about the issue and the correct way to fix it.
This is a [breaking-change] since the error is now reported during wfchecking, so that even the definition of a (potentially) unsized enum will cause an error (whereas it would previously cause an ICE at trans time if the enum was used in an unsized manner).
Consider this code:
What I get:
I expected the compiler to tell me, that
enum EnumTest { A([usize]), }
is not possible, as the size of A is not known at compile-time. Instead it panics. Test it https://play.rust-lang.org/?gist=2f36e717877a374b267eb072a0279614&version=stable&backtrace=1 in the Playground.
The text was updated successfully, but these errors were encountered: