Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.17.8 build error as a normal part of cargo build #2138

Open
rlovell3 opened this issue Aug 25, 2024 · 3 comments
Open

0.17.8 build error as a normal part of cargo build #2138

rlovell3 opened this issue Aug 25, 2024 · 3 comments

Comments

@rlovell3
Copy link

I don't use ring directly. One of my project dependencies depends on ring. After running cargo update on my project, and then attempting cargo build, I get a compile error during the ring compile. I will be reverting my cargo.lock file. This looks like a simple fix, although I will leave that up to the original developer.

Compiling ring v0.17.8
error[E0283]: type annotations needed
--> /home/x/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.13.5/build.rs:482:52
|
482 | let _ = c.flag("-Wl,--gc-sections".into());
| ---- ^^^^
| |
| required by a bound introduced by this call
|
= note: multiple impls satisfying _: AsRef<OsStr> found in the following crates: cc, std:
- impl AsRef for OsStr;
- impl AsRef for OsString;
- impl AsRef for Path;
- impl AsRef for PathBuf;
- impl AsRef for String;
- impl AsRef for str;
- impl AsRef for windows_registry::Env;
note: required by a bound in Build::flag
--> /home/x/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cc-1.1.14/src/lib.rs:533:39
|
533 | pub fn flag(&mut self, flag: impl AsRef) -> &mut Build {
| ^^^^^^^^^^^^ required by this bound in Build::flag
help: try using a fully qualified path to specify the expected types
|
482 | let _ = c.flag(<&str as Into>::into("-Wl,--gc-sections"));
| ++++++++++++++++++++++++ ~
help: consider removing this method call, as the receiver has type &'static str and &'static str: AsRef<OsStr> trivially holds
|
482 - let _ = c.flag("-Wl,--gc-sections".into());
482 + let _ = c.flag("-Wl,--gc-sections");

@rlovell3
Copy link
Author

In the end, I removed the ".into()" as the compiler suggested, and it compiled. I didn't run any tests on it though, and thus won't be submitting a PR. But this worked for me.

@briansmith
Copy link
Owner

We should do a new release of the current Git main branch, as I think the current main branch resolves this.

@briansmith
Copy link
Owner

What version of cargo/rustc are you using? cargo --version? I tried it with cargo 1.81.0 (2dbb1af80 2024-08-20) and it worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants