Closed sax closed 4 months ago
Thanks for reporting this.
Looks like a similar to issue was opened for rustc
3 weeks ago https://github.com/rust-lang/rust/issues/123418
Mind sharing a simple bridge module that reproduces this warning?
I cannot reproduce this warning using the provided example.
Also on nightly some of the ui
tests fail to run. It looks like very minor issues - unexpected warnings (maybe related to that issue?) and some of the spans seem to have changed.
@chinedufn Took a bit longer than expected, but here's a gist you can clone and see the issue: https://gist.github.com/sax/9c4b3b841d15ed62fde135da28b783fa
This error occurs on Rust 1.79.0, which was just released yesterday.
Ok, I just verified that this problem happens when bridging a function or method returning a Result
where the error variant is an ffi struct. When I instead change all of my code to return a Result<whatever, String>
, then the compiler warning disappears.
I take advantage of the ?
operator quite a bit, so am going to hold off on making the change. I've been going through the swift-bridge code as well as the expansion of my crate (using cargo-expand
), but I really can't see where the problem is coming from.
I have a struct that I use to convert wrapped errors to strings that can be sent to Swift:
This compiles without any errors in Rust 1.77.2, but when I compile it with nightly it produces the following warning:
I'm starting to play around with cross-compiling to watchOS, tvOS, and eventually visionOS, but am finding these targets only seem to build on nightly.