netvl / xml-rs

An XML library in Rust
MIT License
459 stars 110 forks source link

0.8.12's field types in xml::common::TextPosition break existing code #224

Closed dtolnay closed 1 year ago

dtolnay commented 1 year ago

Version 0.8.12 of xml-rs has a different definition of xml::common::TextPosition compared to 0.8.11 and previous versions.

The relevant commit looks to be https://github.com/netvl/xml-rs/commit/4fcfab26865466a0594b21caf134ba0cc7d39325.

This causes failures such as the following in code written against xml-rs 0.8.11.

error[E0308]: arguments to this enum variant are incorrect
   --> /Users/adam/.cargo/registry/src/github.com-1ecc6299db9ec823/plist-0.5.5/src/stream/xml_reader.rs:195:5
    |
195 |     FilePosition::LineColumn(pos.row, pos.column)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ -------  ---------- expected `u64`, found `u32`
    |                              |
    |                              expected `u64`, found `u32`
    |
note: tuple variant defined here
   --> /Users/adam/.cargo/registry/src/github.com-1ecc6299db9ec823/plist-0.5.5/src/error.rs:63:5
    |
63  |     LineColumn(u64, u64),
    |     ^^^^^^^^^^
help: you can convert a `u32` to a `u64`
    |
195 |     FilePosition::LineColumn(pos.row.into(), pos.column)
    |                                     +++++++
help: you can convert a `u32` to a `u64`
    |
195 |     FilePosition::LineColumn(pos.row, pos.column.into())
    |                                                 +++++++
kornelski commented 1 year ago

Sorry, I forgot these fields were public. Yanked + fixed in 0.8.13.