Rollup merge of #130598 - gurry:130310-improper-types-stack-overflow, r=compiler-errors

Add recursion limit to FFI safety lint

Fixes #130310

Now we check against `tcx.recursion_limit()` and raise an error if it the limit is reached instead of overflowing the stack.
This commit is contained in:
Matthias Krüger 2024-09-21 07:22:47 +02:00 committed by GitHub
commit 28ace83b11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 50 additions and 18 deletions

View file

@ -395,6 +395,8 @@ lint_improper_ctypes_opaque = opaque types have no C equivalent
lint_improper_ctypes_pat_help = consider using the base type instead
lint_improper_ctypes_pat_reason = pattern types have no C equivalent
lint_improper_ctypes_recursion_limit_reached = type is infinitely recursive
lint_improper_ctypes_slice_help = consider using a raw pointer instead
lint_improper_ctypes_slice_reason = slices have no C equivalent