Bug found by AI, validated by me
Full report with more possible problems - jiff_20260804.html
CPY_2 LOW
Description: In crates/jiff/src/error/tz/zic.rs, the Display arm for Error::FailedParseFieldAt writes "failed to parse NAME field", which is an exact copy of the message used for the unrelated Error::FailedParseFieldName variant. FailedParseFieldAt is constructed in crates/jiff/src/tz/zic.rs:388 specifically when parsing a rule's AT field (at_field.parse::<RuleAtP>().context(E::FailedParseFieldAt)?), so its error text should mention the AT field, not NAME. Every other FailedParseField* variant in this enum correctly names its own field (FROM, IN, LETTERS, ON, RULES, SAVE, STDOFF, TO, UNTIL), confirming FailedParseFieldAt was copy-pasted from FailedParseFieldName without updating the field name in the message.
Locations:
crates/jiff/src/error/tz/zic.rs:222-224
222 | FailedParseFieldAt => {
223 | f.write_str("failed to parse `NAME` field")
224 | }
crates/jiff/src/error/tz/zic.rs:243-245
243 | FailedParseFieldName => {
244 | f.write_str("failed to parse `NAME` field")
245 | }
Fix: Change the FailedParseFieldAt arm to reference the AT field instead of NAME:
FailedParseFieldAt => {
f.write_str("failed to parse `AT` field")
}
|
FailedParseFieldAt => { |
|
f.write_str("failed to parse `NAME` field") |
|
} |
|
FailedParseFieldName => { |
|
f.write_str("failed to parse `NAME` field") |
|
} |
Bug found by AI, validated by me
Full report with more possible problems - jiff_20260804.html
CPY_2
LOWDescription: In
crates/jiff/src/error/tz/zic.rs, theDisplayarm forError::FailedParseFieldAtwrites"failed to parseNAMEfield", which is an exact copy of the message used for the unrelatedError::FailedParseFieldNamevariant.FailedParseFieldAtis constructed incrates/jiff/src/tz/zic.rs:388specifically when parsing a rule'sATfield (at_field.parse::<RuleAtP>().context(E::FailedParseFieldAt)?), so its error text should mention theATfield, notNAME. Every otherFailedParseField*variant in this enum correctly names its own field (FROM,IN,LETTERS,ON,RULES,SAVE,STDOFF,TO,UNTIL), confirmingFailedParseFieldAtwas copy-pasted fromFailedParseFieldNamewithout updating the field name in the message.Locations:
Fix: Change the
FailedParseFieldAtarm to reference theATfield instead ofNAME:jiff/crates/jiff/src/error/tz/zic.rs
Lines 222 to 224 in d9aab6f
jiff/crates/jiff/src/error/tz/zic.rs
Lines 243 to 245 in d9aab6f