encoding_rs
encoding_rs copied to clipboard
0.8.29 should be a major bump
Commit https://github.com/hsivonen/encoding_rs/commit/cecda92386d0e1db7961e25690e86bdabfaee064 introduces an alloc
feature and adds it to the defaults. Unfortunately this breaks semver, in particularly for those crates that use cargo parametr default-features = false
. As an example you may easily reproduce it with rust-fontconfig = "0.1.5"
dependency, its output:
error[E0599]: no method named `decode_to_string_without_replacement` found for struct `Decoder` in the current scope
--> /home/kitsu/.cargo/registry/src/github.com-1ecc6299db9ec823/allsorts_no_std-0.5.2/src/get_name.rs:94:36
|
94 | let (res, _read) = decoder.decode_to_string_without_replacement(data, &mut s, true);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: there is an associated function with a similar name: `decode_to_str_without_replacement`
error: aborting due to previous error
and manually downgrading encoding_rs = "0.8.28"
in Cargo.lock solves the problem.
That's sad. Since there were no default features previously, my assumption was that no one would have had a reason to do default-features = false
and a one-time addition of default features would be semver-compatible.
Do I understand correctly that default-features = false
is transitive so that rust-fontconfig
setting default-features = false
for allsorts_no_std
ends up causing allsorts_no_std
to propagate default-features = false
to encoding_rs
despite allsorts_no_std
not saying so?
Actually there's something strange published for allsorts_no_std
, it's cargo.toml differs from the github sources. It directly disables features of encoding_rs
. Apparently rust-fontconfig
is redundant for the example.
I've examined quite a number of crates the depend on encoding_rs
, and allsorts_no_std
is an exception by disabling default features before there were any to disable. Instead of yanking the latest encoding_rs
right away, I'm going to see if a new release of allsorts_no_std
could be made.