Closed Bug 1478115 Opened 7 years ago Closed 7 years ago

Can't distinguish foreign functions in Rust that are defined in C++

Categories

(Webtools :: Searchfox, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emilio, Assigned: emilio)

Details

It always pisses me off that I can't jump, e.g., from: https://searchfox.org/mozilla-central/rev/d160ac574a5798010eda4e33e91ee628aa268a33/servo/components/style/gecko_bindings/sugar/refptr.rs#292 To the C++ definition. This happens because there's no way to differentiate: extern "C" { fn MyFunc(); } from: fn MyFunc() {}. I can hack on bindgen to manually add the no_mangle / link_name attribute so that I can detect it, but it'd be even better to make it work in the general case, which is https://github.com/nrc/rls-data/issues/17
For reference, the mozsearch repo now has all the updated dependencies that it can add the special handling for DefKind::ForeignFunction and DefKind::ForeignStatic. However the save-analysis files are coming from the m-c taskcluster build, and those are being generated by (I think) rustc 1.28 at the moment, which doesn't yet have the RLS bump. I think that's in 1.30.0, so once m-c is getting compiled by 1.30 the special handling will "kick in".

Looks like this works now. Can you confirm and close this bug if so?

Flags: needinfo?(emilio)
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(emilio)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.