Merge pull request #560 from dtolnay/relocatable

Mark all shared structs as relocatable
This commit is contained in:
David Tolnay 2020-12-10 12:04:51 -08:00 committed by GitHub
commit 665b7f5b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,9 +233,7 @@ fn write_struct<'a>(out: &mut OutFile<'a>, strct: &'a Struct, methods: &[&Extern
writeln!(out, "{};", field.ident);
}
if !methods.is_empty() || operator_eq || operator_ord {
writeln!(out);
}
writeln!(out);
for method in methods {
write!(out, " ");
@ -281,6 +279,9 @@ fn write_struct<'a>(out: &mut OutFile<'a>, strct: &'a Struct, methods: &[&Extern
);
}
out.include.type_traits = true;
writeln!(out, " using IsRelocatable = ::std::true_type;");
writeln!(out, "}};");
writeln!(out, "#endif // {}", guard);
}