Skip to content

Commit

Permalink
Merge pull request #1099 from dtolnay/vecarray
Browse files Browse the repository at this point in the history
Allow Rust vector of array of trivially relocatable type
  • Loading branch information
dtolnay committed Sep 19, 2022
2 parents 8307582 + 072fd4f commit f2aecb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gen/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,10 @@ fn check_trivial_extern_type(out: &mut OutFile, alias: &TypeAlias, reasons: &[Tr
writeln!(out, "static_assert(");
if reasons
.iter()
.all(|r| matches!(r, TrivialReason::StructField(_)))
.all(|r| matches!(r, TrivialReason::StructField(_) | TrivialReason::VecElement))
{
// If the type is only used as a struct field and not as by-value
// function argument or any other use, then C array of trivially
// If the type is only used as a struct field or Vec element, not as
// by-value function argument or return value, then C array of trivially
// relocatable type is also permissible.
//
// --- means something sane:
Expand Down

0 comments on commit f2aecb0

Please sign in to comment.