lint ImproperCTypes: confirm that Box<FfiSafeType> and Option<Box<FfiSafeType>> are FFI-safe in function declarations too
This commit is contained in:
parent
d857bc8fbb
commit
9b59dd8178
3 changed files with 27 additions and 63 deletions
|
@ -866,7 +866,7 @@ fn ty_is_known_nonnull<'tcx>(
|
|||
match ty.kind() {
|
||||
ty::FnPtr(..) => true,
|
||||
ty::Ref(..) => true,
|
||||
ty::Adt(def, _) if def.is_box() && matches!(mode, CItemKind::Definition) => true,
|
||||
ty::Adt(def, _) if def.is_box() => true,
|
||||
ty::Adt(def, args) if def.repr().transparent() && !def.is_union() => {
|
||||
let marked_non_null = nonnull_optimization_guaranteed(tcx, *def);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue