Tracking issue for restricted feature name syntax. #8813
Labels
A-features
Area: features — conditional compilation
C-tracking-issue
Category: A tracking issue for something unstable.
S-needs-mentor
Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.
S-waiting-on-feedback
Status: An implemented feature is waiting on community feedback for bugs or design concerns.
This issue is for tracking a backwards-incompatible change to add new restrictions to the syntax of a feature name.
Historically, Cargo has been extremely permissive for feature names, allowing them to be any string as long as it isn't empty. crates.io has imposed its own limitations on feature names, specifically all characters must be
is_ascii_alphanumeric
,-
,_
, or+
.We would like to introduce new syntax to the feature system to introduce new capabilities. For example, prefixes such as
dep:
, or the?
character for weakly enabling features. However, this extended syntax may conflict with existing feature names if a project is using punctuation or other symbols in their feature names.The new feature name restrictions are:
_
._
, or most letters),-
, or+
.This is being initially implemented as a warning with the intent to make it an error sometime in the future.
We do not expect this to be a problem for projects, since crates.io already imposes strict requirements on the feature name syntax. However, for projects that aren't published to crates.io, it may be possible that they will conflict with the new restrictions.
If your project has encountered the new warning, please leave a comment explaining which characters you are using with an example, and an indication if it would be difficult or possible for you to transition to the more restrictive syntax.
The text was updated successfully, but these errors were encountered: