When I run cargo command. be like...
you've written an assertion i think, it does not pass.
The assertion is in the curl
crate as compiled into cargo
, nothing they wrote.
It's due to an error return from curl_sys::curl_global_init
,[1] but the man page was uninformative about error codes,[2] so that's where I stopped digging.
Thank you, I've thought OP was writing his own library.
The code is actually no better - it returns a single error code for everything, likely relying on the callees to report any error details in debug logs.
This morning, I just switched branches in my code project, then when I ran cargo build
,cargo check
,cargo run
, I got an error, the same error shown in the picture. After that, when I only ran cargo
, I still got the same error. Eventually, I decided to try rustup install 1.75.0
and set it as default with rustup default 1.75.0
. Lowering the version of cargo and Rust resolved the issue.I've been using the latest stable version of Rust, maybe it's an issue with the latest stable version.
Sounds like it might be an actual regression (though other possibilities also exist). If you can reproduce the error by switching to a specific version, consider filing a bug report.
Switching back to the latest version with rustup
doesn't reproduce the error anymore, so I'll stick with version 1.75.0 for now.
Did you also close the command shell then open a new one in between the tests?
I tried it, but it didn't work.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.