Don't unwrap but report a fatal error for TargetDataLayout::parse.

This commit is contained in:
Mara Bos 2020-09-20 12:39:07 +02:00
parent db74e1f1e3
commit 9e3f94dabc

View File

@ -749,7 +749,9 @@ pub fn default_configuration(sess: &Session) -> CrateConfig {
let min_atomic_width = sess.target.target.min_atomic_width();
let max_atomic_width = sess.target.target.max_atomic_width();
let atomic_cas = sess.target.target.options.atomic_cas;
let layout = TargetDataLayout::parse(&sess.target.target).unwrap();
let layout = TargetDataLayout::parse(&sess.target.target).unwrap_or_else(|err| {
sess.fatal(&err);
});
let mut ret = FxHashSet::default();
ret.reserve(6); // the minimum number of insertions