mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2025-02-23 01:54:12 +00:00
Allow Rust vector of array of trivially relocatable type
This commit is contained in:
parent
83075824a4
commit
072fd4f0a3
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user