From 039178fdb7553ef731c299e733b9143af7ec307a Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Wed, 8 Nov 2023 23:36:15 +0800 Subject: [PATCH 1/2] Fix the invalidate feature name message Signed-off-by: hi-rustin --- src/cargo/core/summary.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, From 976835d0455c7ceef7ba45e16840327558fefbf4 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Wed, 8 Nov 2023 23:40:24 +0800 Subject: [PATCH 2/2] Update the test for the msg change Signed-off-by: hi-rustin --- tests/testsuite/features.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) ", )