-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add transmute_mut!
macro
#550
Conversation
6d357d9
to
dccd6f5
Compare
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.
Just skimming; I'll take more of a look later once it's ready for review.
0662549
to
a6e0d10
Compare
src/lib.rs
Outdated
let u; | ||
|
||
$crate::assert_size_eq!(t, u); | ||
|
||
&u |
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.
Slight stylistic preference for grouping these together, but feel free to ignore this.
Same in the next branch.
let u; | |
$crate::assert_size_eq!(t, u); | |
&u | |
let u; | |
$crate::assert_size_eq!(t, u); | |
&u |
src/lib.rs
Outdated
// Reborrow so that mutable references are supported too. | ||
// | ||
// In the rest of the comments, we refer only to `&T` since this | ||
// reborrow ensures that `e` is an immutable reference. | ||
let e = &mut *$e; |
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.
Is this necessary for transmute_mut!
?
src/lib.rs
Outdated
{ | ||
loop {} | ||
} | ||
transmute(&mut *e) |
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.
Can this not just be transmute(e)
?
src/lib.rs
Outdated
let u; | ||
|
||
$crate::assert_size_eq!(t, u); | ||
|
||
&mut u |
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.
Same here, also optional.
let u; | |
$crate::assert_size_eq!(t, u); | |
&mut u | |
let u; | |
$crate::assert_size_eq!(t, u); | |
&mut u |
src/lib.rs
Outdated
let mut u = unreachable!(); | ||
|
||
$crate::assert_align_gt_eq!(t, u); | ||
|
||
&mut u |
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.
Same here, also optional.
let mut u = unreachable!(); | |
$crate::assert_align_gt_eq!(t, u); | |
&mut u | |
let mut u = unreachable!(); | |
$crate::assert_align_gt_eq!(t, u); | |
&mut u |
4661929
to
9a6ec7a
Compare
0ad7e2b
to
b30dab4
Compare
This macro is like the existing `transmute!`, but it transmutes mutable references rather than values. Releasing 0.7.17 Issue #159
b30dab4
to
32633ce
Compare
This macro is like the existing
transmute!
, but it transmutes mutable references rather than values.Issue #159