Fix an ICE on a cast from an inferred nil to uint

Fixes #10991.
auto merge of #14854 : jakub-/rust/issue-10991, r=pcwalton

Fixes #10991.