Fix deriving Encodable trait for unit structs

Closes #14021
auto merge of #14596 : Sawyer47/rust/encodable-fix, r=alexcrichton

Closes #14021