librustc: Enum nullable pointer opt should not apply to raw pointers.
This commit is contained in:
parent
06c0b1d28a
commit
a152d5fced
2 changed files with 7 additions and 3 deletions
|
|
@ -37,4 +37,9 @@ fn main() {
|
|||
assert_eq!(size_of::<Box<int>>(), size_of::<Option<Box<int>>>());
|
||||
assert_eq!(size_of::<Gc<int>>(), size_of::<Option<Gc<int>>>());
|
||||
|
||||
|
||||
// The optimization can't apply to raw pointers
|
||||
assert!(size_of::<Option<*const int>>() != size_of::<*const int>());
|
||||
assert!(Some(0 as *const int).is_some()); // Can't collapse None to null
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue