diff options
| author | David Tolnay <dtolnay@gmail.com> | 2021-04-16 11:50:51 -0700 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2021-06-04 22:19:43 -0700 |
| commit | abfad74ec6326b806509a676b6527e8d645d4fdf (patch) | |
| tree | 5201a814bf6b3f03d2c571b6846f7acc41aba19e /compiler/rustc_lint/src | |
| parent | c17e3e2c09ad984341d34fff9cd67d706d46157d (diff) | |
Make *const (), *mut () okay for FFI
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/types.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs index 5d2256100ff..4e3bbc58559 100644 --- a/compiler/rustc_lint/src/types.rs +++ b/compiler/rustc_lint/src/types.rs @@ -1060,6 +1060,15 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> { FfiSafe } + ty::RawPtr(ty::TypeAndMut { ty, .. }) + if match ty.kind() { + ty::Tuple(tuple) => tuple.is_empty(), + _ => false, + } => + { + FfiSafe + } + ty::RawPtr(ty::TypeAndMut { ty, .. }) | ty::Ref(_, ty, _) => { self.check_type_for_ffi(cache, ty) } |
