-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spurious "infinitely recursive" not ffi-safe warning #130757
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
L-improper_ctypes
Lint: improper_ctypes
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Sep 23, 2024
jieyouxu
added
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
L-improper_ctypes
Lint: improper_ctypes
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Sep 23, 2024
cc #130598 which introduced the recursion limit. |
jieyouxu
removed
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Sep 23, 2024
Repro: #![recursion_limit = "5"]
#![deny(improper_ctypes)]
#[repr(C)]
struct F1(*const ());
#[repr(C)]
struct F2(*const ());
#[repr(C)]
struct F3(*const ());
#[repr(C)]
struct F4(*const ());
#[repr(C)]
struct F5(*const ());
#[repr(C)]
struct F6(*const ());
#[repr(C)]
struct B {
f1: F1,
f2: F2,
f3: F3,
f4: F4,
f5: F5,
f6: F6,
}
extern "C" fn foo(_: B) {} |
Anyways I'll put up a revert PR @rustbot claim |
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this issue
Sep 24, 2024
…mit, r=jieyouxu Revert "Add recursion limit to FFI safety lint" It's not necessarily clear if warning when we hit the recursion limit is the right thing to do, first of all. **More importantly**, this PR was implemented incorrectly in the first place; it was not decrementing the recursion limit when stepping out of a type, so it would trigger when a ctype has more than RECURSION_LIMIT fields *anywhere* in the type's set of recursively reachable fields. Reverts rust-lang#130598 Reopens rust-lang#130310 Fixes rust-lang#130757
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 24, 2024
Rollup merge of rust-lang#130758 - compiler-errors:ctype-recursion-limit, r=jieyouxu Revert "Add recursion limit to FFI safety lint" It's not necessarily clear if warning when we hit the recursion limit is the right thing to do, first of all. **More importantly**, this PR was implemented incorrectly in the first place; it was not decrementing the recursion limit when stepping out of a type, so it would trigger when a ctype has more than RECURSION_LIMIT fields *anywhere* in the type's set of recursively reachable fields. Reverts rust-lang#130598 Reopens rust-lang#130310 Fixes rust-lang#130757
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
L-improper_ctypes
Lint: improper_ctypes
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The windows-rs crate is getting a whole bunch of spurious FFI-safe warnings:
See: https://github.com/microsoft/windows-rs/actions/runs/10997420795/job/30532923854?pr=3291
The text was updated successfully, but these errors were encountered: