error: `extern` fn uses type `for<'r> fn(&'r ThinVec<nsCString>) -> bool`, which is not FFI-safe
Categories
(Core :: Networking: DNS, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | unaffected |
firefox81 | --- | unaffected |
firefox82 | --- | unaffected |
firefox83 | --- | fixed |
People
(Reporter: sg, Assigned: emilio)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [necko-triaged])
Attachments
(3 files)
Since updating mozilla-central today, I get the following error when building:
1:09.62 Compiling netwerk_helper v0.0.1 (/home/simon/work/refactor/netwerk/base/rust-helper)
1:09.90 error: `extern` fn uses type `for<'r> fn(&'r ThinVec<nsCString>) -> bool`, which is not FFI-safe
1:09.90 --> netwerk/base/rust-helper/src/lib.rs:323:76
1:09.90 |
1:09.90 323 | pub extern "C" fn rust_parse_etc_hosts<'a>(path: &'a nsACString, callback: ParsingCallback) {
1:09.90 | ^^^^^^^^^^^^^^^ not FFI-safe
1:09.90 |
1:09.91 = note: `-D improper-ctypes-definitions` implied by `-D warnings`
1:09.91 = help: consider using an `extern fn(...) -> ...` function pointer instead
1:09.91 = note: this function pointer has Rust-specific calling convention
1:09.91 error: aborting due to previous error
1:09.92 error: could not compile `netwerk_helper`
I did rustup update
but it didn't fix this.
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 2•4 years ago
|
||
Valentin, is it possible to make this work with Rust nightly as well?
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Using extern fn is needed to avoid a warning, but also this avoids copying the
filename when it's already valid utf-8, and makes some other minor cosmetic
tweaks, like removing useless move
in lambdas and so on.
Assignee | ||
Comment 4•4 years ago
|
||
All these functions use snake case so they're not needed.
Depends on D92182
Assignee | ||
Comment 5•4 years ago
|
||
No need to cast a byte as a char to test it against ascii characters.
Depends on D92183
Comment 6•4 years ago
|
||
Emilio is blazing fast 🙂
Thanks a lot for fixing this so quickly. My compiler was just warming up.
Updated•4 years ago
|
Comment 8•4 years ago
|
||
Set release status flags based on info from the regressing bug 1616252
Comment 9•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1d7ff6f2d3ae
https://hg.mozilla.org/mozilla-central/rev/fb2e42f334c6
https://hg.mozilla.org/mozilla-central/rev/37cd0824dd4b
Updated•3 years ago
|
Description
•