-
Notifications
You must be signed in to change notification settings - Fork 349
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
implement more casts #50
Conversation
@@ -244,6 +246,8 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> { | |||
} | |||
|
|||
fn type_is_sized(&self, ty: Ty<'tcx>) -> bool { | |||
// generics are weird, don't run this function on a generic | |||
debug_assert_eq!(self.monomorphize(ty, self.substs()), ty); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can check this with ty.needs_substs()
which is basically free.
IMO debug_assert
is bad in the compiler (compared to always-on cheap checks) because users won't trigger it.
@oli-obk AFAICT this doesn't have unsizing. |
unsizing has its own variant |
|
good point... so yea, the last box should be checked, but we need to wait for vtables now. |
not sure if this is all of #26