Skip to content
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

Merged
merged 3 commits into from
Sep 8, 2016
Merged

implement more casts #50

merged 3 commits into from
Sep 8, 2016

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Sep 7, 2016

not sure if this is all of #26

@@ -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);
Copy link
Member

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.

@eddyb
Copy link
Member

eddyb commented Sep 8, 2016

@oli-obk AFAICT this doesn't have unsizing.

@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 8, 2016

unsizing has its own variant Unsize, it isn't part of Misc

@eddyb
Copy link
Member

eddyb commented Sep 8, 2016

@oli-obk Right, I meant #26 includes unsizing so this wouldn't tick all those boxes.

@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 8, 2016

Unsize is handled, and I can't produce any examples that do an unsize cast and aren't correctly handled by miri.

@eddyb
Copy link
Member

eddyb commented Sep 8, 2016

@oli-obk But I thought vtables weren't implemented (and the box isn't ticked off in #26).

@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 8, 2016

good point... so yea, the last box should be checked, but we need to wait for vtables now.

@solson solson merged commit 248bfde into rust-lang:master Sep 8, 2016
@oli-obk oli-obk deleted the casts branch September 8, 2016 09:14
erickt pushed a commit to erickt/miri that referenced this pull request Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants