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

Fix hyphens on target names error #78

Merged
merged 2 commits into from
Mar 26, 2015

Conversation

filipegoncalves
Copy link
Contributor

As of the latest nightly, the rules in https://github.com/rust-lang/rfcs/blob/master/text/0940-hyphens-considered-harmful.md are now fully implemented and in use. This patch fixes the errors on cargo build that arise when attempting to build projects that depend on this library:

Unable to get packages from source

Caused by:
  failed to parse manifest at `/home/filipe/.cargo/registry/src/github.com-1ecc6299db9ec823/encoding-index-simpchinese-1.20141219.1/Cargo.toml`

Caused by:
  target names cannot contain hyphens: encoding-index-simpchinese

@SimonSapin
Copy link
Collaborator

Looks good, thanks!

Using unstable features without #![feature(...)] is now also an error. (See Travis-CI logs.) Could you fix that as well?

@filipegoncalves
Copy link
Contributor Author

Thanks for the feedback. I updated the PR to fix the unstable features error.

Adding #![feature(core)] to the crate's attributes does seem to solve the additional errors, just like the compiler suggests, but although all the errors go away, it spits a somewhat annoying warning about "unused or unknown feature". After a brief discussion on IRC, it seems like a bug in rust internals.

I decided to leave it like that for now, since there's no apparent fix to make the warning disappear.

@SimonSapin
Copy link
Collaborator

It looks like some of the *-index crates also need #![feature(core)] (or perhaps #![cfg_attr(test, feature(core))]) as well. You can run make test to run tests in every crate.

… and by the time I typed this, I see you’ve already pushed a fix :)

@filipegoncalves
Copy link
Contributor Author

Yep, I saw it :) It should build now.

UPDATE: turns out the warning is not a bug in Rust. It was my fault - indeed, feature(core) in some cases was needed for tests only, wrapping it in cfg_attr fixed it.

lifthrasiir added a commit that referenced this pull request Mar 26, 2015
Fix hyphens on target names error
@lifthrasiir lifthrasiir merged commit 726b0ac into lifthrasiir:master Mar 26, 2015
@lifthrasiir
Copy link
Owner

Thank you!

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

Successfully merging this pull request may close these issues.

None yet

3 participants