Skip to content
Myr

Test null pointer optimization of Result<(), Error>

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 63f14db · Browse files · 1 file+5 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−0 removed

  • tests:+5 added−0 removed

1 file+5 added−0 removed

modified:tests/test_repr.rs+5 added
12 unmodified lines
13 assert_eq!(mem::size_of::<Error>(), mem::size_of::<usize>());14}1516#[test]17fn test_null_pointer_optimization() {18 assert_eq!(mem::size_of::<Result<(), Error>>(), mem::size_of::<usize>());19}2021#[test]22fn test_autotraits() {23 fn assert<E: Unpin + Send + Sync + 'static>() {}24 assert::<Error>();25}
7 unmodified lines