Skip to content

cargo fmt breaks pyo3 #2824

Closed
Closed
@konstin

Description

@konstin

rusfmt breaks pyo3 in the sense that it doesn't build after running cargo fmt.

Reproducing:

git clone https://github.com/pyo3/pyo3
cd pyo3
git checkout 68c14a5707dd92ceef7619c0a5444cefcc78a0f6 # Recent, but fixed commit
cargo build # Fine
cargo fmt
cargo build # Broken

The last command results in a conflicting implementations error, even though only the formatting should have changed:

error[E0119]: conflicting implementations of trait `python::IntoPyDictPointer` for type `()`:
   --> src/objects/dict.rs:247:1
    |
247 | / impl<K, V, I> IntoPyDictPointer for I
248 | | where
249 | |     K: ToPyObject,
250 | |     V: ToPyObject,
...   |
260 | |     }
261 | | }
    | |_^ conflicting implementation for `()`
    | 
   ::: src/noargs.rs:61:1
    |
61  |   impl IntoPyDictPointer for () {
    |   ----------------------------- first implementation here
    |
    = note: upstream crates may add new impl of trait `std::iter::Iterator` for type `()` in future versions

Versions:

  • cargo fmt --version: rustfmt 0.8.2-nightly (87edd75 2018-06-22)
  • rustc --version: rustc 1.28.0-nightly (e3bf634 2018-06-28)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions