-
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
Type alias fails to produce a type error for unsized type #46027
Comments
While mentioning this on IRC @thepowersgang noted that mrustc deliberately doesn't typecheck type alias declarations because it encountered unexpected compilation failures while testing against crates.io. I'm still hopeful that such an invalid declaration would be impossible to instantiate, but it's possible that the failures mrustc encountered were more insidious than the simple test case here. Because of this discovery, nominating for discussion based on the backcompat hazard this might present. |
Note for the above - The failing code was along the lines of |
From RFC 1214:
|
Interesting. RFC 1214 is tracked at #27579, would be good to know if there's any more clarity since 2015 on how we ought to be handling this. |
Here's a program that we expect to fail to compile, and happily it does fail to compile:
Here's the happy error message:
Here's the actual bug: if we use a type alias here rather than a newtype, this does not fail to compile:
Fortunately it appears to be impossible to actually instantiate this, but surely this should fail to compile just as the first example does.
The text was updated successfully, but these errors were encountered: