Rollup merge of #47626 - eddyb:one-less-unwrap, r=nagisa
Rollup merge of #47626 - eddyb:one-less-unwrap, r=nagisa

rustc_trans: remove an unwrap by replacing a bool with Result.

Prompted by @shepmaster.
r? @nagisa

GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust