Skip to content

Conversation

pcwalton
Copy link
Contributor

Issue #14468.

After a snapshot, it will be possible to remove the extern crate foo = STRING syntax in favor of the new extern crate foo = IDENT.

This will break crates that have names that are not valid Rust
identifiers (in particular, those that contain hyphens). Change such
crates to have names that correspond to valid Rust identifiers. (Most
commonly, this will involve changing hyphens to underscores.)

[breaking-change]

r? @brson

This may require an RFC to be merged first, but I wanted to go ahead and get the work done.

Issue rust-lang#14468.

After a snapshot, it will be possible to remove the `extern crate foo =
STRING` syntax in favor of the new `extern crate foo = IDENT`.

This will break crates that have names that are not valid Rust
identifiers (in particular, those that contain hyphens). Change such
crates to have names that correspond to valid Rust identifiers. (Most
commonly, this will involve changing hyphens to underscores.)

[breaking-change]
@alexcrichton
Copy link
Member

The corresponding RFC for this is rust-lang/rfcs#109, and this should probably wait for that to be merged.

@flaper87
Copy link
Contributor

Also, the RFC should be mentioned in the commit message. Something to do during the rebase.

@alexcrichton
Copy link
Member

The RFC has been accepted now, and the relevant section for this issue dictates that the syntax is still extern crate foo = "string-literal", but the string literal now only accepts a subset of the characters accepted today. Notably, the string-literal must be a valid rust identifier with the exception that a - character is allowed in any position other than the first.

@alexcrichton
Copy link
Member

Superseded by #15319

flip1995 pushed a commit to flip1995/rust that referenced this pull request May 31, 2025
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.

3 participants