-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Allow passing unsized types to std::intrinsics::get_tydesc #21170
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @huonw (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see CONTRIBUTING.md for more information. |
Thanks! Could you squash the two commits into one? |
Np, done |
Handing off to someone who knows more about this code: r? @nick29581 |
@@ -459,7 +459,6 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>) | |||
} | |||
ty::ty_vec(ty, None) => tvec::make_drop_glue_unboxed(bcx, v0, ty, false), | |||
_ => { | |||
assert!(type_is_sized(bcx.tcx(), t)); |
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.
this is a bit suspicious, what kind of type triggers this assertion? Is it str
? I expect we should be dealing with ty_str in the same way as ty_vec, but it seems to be missing treatment all over this file. This is not really your problem to fix (unless you want to!). I suggest creating a ty_str branch and panic!ing in it, with a FIXME comment, leave the assertion in, and change the test to use something other than a str
Made the changes - it seemed easier to just return the correct alignment instead of adding a FIXME, since it's a one line change. |
thanks! r=me with the commits squashed |
Fix tabs Added missing ty_str cases when generating type descriptions Reduce code duplication and improve test
While it's unstable and will probably be replaced or "reformed" at some point, it's useful in the mean time to be able to introspect the type system when debugging, and not be limited to sized types. Fixes rust-lang#21058
While it's unstable and will probably be replaced or "reformed" at some point, it's useful in the mean time to be able to introspect the type system when debugging, and not be limited to sized types.
Fixes #21058