diff --git a/src/cargo/core/summary.rs b/src/cargo/core/summary.rs index 128c0db9cb1..2fa79b1c25d 100644 --- a/src/cargo/core/summary.rs +++ b/src/cargo/core/summary.rs @@ -448,7 +448,7 @@ fn validate_feature_name(pkg_id: PackageId, name: &str) -> CargoResult<()> { if !(unicode_xid::UnicodeXID::is_xid_continue(ch) || ch == '-' || ch == '+' || ch == '.') { bail!( "invalid character `{}` in feature `{}` in package {}, \ - characters must be Unicode XID characters, `+`, or `.` \ + characters must be Unicode XID characters, '-', `+`, or `.` \ (numbers, `+`, `-`, `_`, `.`, or most letters)", ch, name, diff --git a/tests/testsuite/features.rs b/tests/testsuite/features.rs index 236b6f65181..5502b5e2cf2 100644 --- a/tests/testsuite/features.rs +++ b/tests/testsuite/features.rs @@ -2045,7 +2045,7 @@ error: failed to parse manifest at `[ROOT]/foo/Cargo.toml` Caused by: invalid character `&` in feature `a&b` in package foo v0.1.0 ([ROOT]/foo), \ - characters must be Unicode XID characters, `+`, or `.` \ + characters must be Unicode XID characters, '-', `+`, or `.` \ (numbers, `+`, `-`, `_`, `.`, or most letters) ", )