Skip to content

Commit 321f9e2

Browse files
committed
don't check in arrays, to give smallvec users some time
1 parent 90908b8 commit 321f9e2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/librustc_target/abi/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1154,9 +1154,11 @@ impl<'a, Ty> TyLayout<'a, Ty> {
11541154

11551155
match inner.fields {
11561156
FieldPlacement::Union(..) => true, // An all-0 unit is fine.
1157-
FieldPlacement::Array { count, .. } =>
1158-
count == 0 || // 0-length arrays are always okay.
1159-
inner.field(cx, 0).to_result()?.might_permit_zero_init(cx)?,
1157+
FieldPlacement::Array { .. } =>
1158+
// FIXME: The widely use smallvec 0.6 creates uninit arrays
1159+
// with any element type, so let us not (yet) complain about that.
1160+
// count == 0 || inner.field(cx, 0).to_result()?.might_permit_zero_init(cx)?
1161+
true,
11601162
FieldPlacement::Arbitrary { ref offsets, .. } =>
11611163
// Check that all fields accept zero-init.
11621164
(0..offsets.len()).try_fold(true, |accu, idx|

0 commit comments

Comments
 (0)