-
-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Labels
A-lintArea: new or existing lintArea: new or existing lintE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mentorCall for participation: Mentorship is available for this issue.Call for participation: Mentorship is available for this issue.
Description
A new feature in Rust 1.82+ is the ability to define safe items inside an unsafe extern block:
https://blog.rust-lang.org/2024/10/17/Rust-1.82.0.html#safe-items-with-unsafe-extern
unsafe extern {
pub safe static TAU: f64;
pub safe fn sqrt(x: f64) -> f64;
pub unsafe fn strlen(p: *const u8) -> usize;
}Making a previously-safe item become unsafe is a major breaking change, since it now requires unsafe at the point of use.
At least two lints, and possibly more:
- safe extern static became unsafe
- safe extern fn became unsafe
I believe we'll also need additional schema in the adapter to model extern items and show which items are safe vs unsafe. This shouldn't be too difficult to add, though it's an extra step compared to "just writing a lint." For folks new to contributing to Trustfall, I'd recommend first writing another lint that doesn't need this extra step before moving to this issue.
Metadata
Metadata
Assignees
Labels
A-lintArea: new or existing lintArea: new or existing lintE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mentorCall for participation: Mentorship is available for this issue.Call for participation: Mentorship is available for this issue.