librustc: Enum nullable pointer opt should not apply to raw pointers.

This commit is contained in:
Luqman Aden 2014-09-11 21:58:01 -04:00
parent 06c0b1d28a
commit a152d5fced
2 changed files with 7 additions and 3 deletions

View file

@ -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
}