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

rustc: Remove support for hyphens in crate names #23786

Merged
merged 4 commits into from
Mar 28, 2015

Conversation

alexcrichton
Copy link
Member

This commit removes parser support for extern crate "foo" as bar as the
renamed crate is now required to be an identifier. Additionally this commit
enables hard errors on crate names that contain hyphens in them, they must now
solely contain alphanumeric characters or underscores.

If the crate name is inferred from the file name, however, the file name
foo-bar.rs will have the crate name inferred as foo_bar. If a binary is
being emitted it will have the name foo-bar and a library will have the name
libfoo_bar.rlib.

This commit is a breaking change for a number of reasons:

  • Old syntax is being removed. This was previously only issuing warnings.
  • The output for the compiler when input is received on stdin is now rust_out
    instead of rust-out.
  • The crate name for a crate in the file foo-bar.rs is now foo_bar which can
    affect infrastructure such as logging.

[breaking-change]

Closes #23533

This commit removes parser support for `extern crate "foo" as bar` as the
renamed crate is now required to be an identifier. Additionally this commit
enables hard errors on crate names that contain hyphens in them, they must now
solely contain alphanumeric characters or underscores.

If the crate name is inferred from the file name, however, the file name
`foo-bar.rs` will have the crate name inferred as `foo_bar`. If a binary is
being emitted it will have the name `foo-bar` and a library will have the name
`libfoo_bar.rlib`.

This commit is a breaking change for a number of reasons:

* Old syntax is being removed. This was previously only issuing warnings.
* The output for the compiler when input is received on stdin is now `rust_out`
  instead of `rust-out`.
* The crate name for a crate in the file `foo-bar.rs` is now `foo_bar` which can
  affect infrastructure such as logging.

[breaking-change]
Conflicts:
	src/libsyntax/parse/parser.rs
@rust-highfive
Copy link
Collaborator

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

This is currently rebased on #23738 for convenience.

@alexcrichton
Copy link
Member Author

r? @brson

@rust-highfive rust-highfive assigned brson and unassigned eddyb Mar 27, 2015
@brson
Copy link
Contributor

brson commented Mar 27, 2015

@bors r+

@bors
Copy link
Contributor

bors commented Mar 27, 2015

📌 Commit e77db16 has been approved by brson

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 27, 2015
Conflicts:
	src/test/auxiliary/static-function-pointer-aux.rs
	src/test/auxiliary/trait_default_method_xc_aux.rs
	src/test/run-pass/issue-4545.rs
@bors bors merged commit e77db16 into rust-lang:master Mar 28, 2015
@alexcrichton alexcrichton deleted the less-quotes branch March 28, 2015 02:00
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.

Tweak how hyphens in crate names are allowed
5 participants