Skip to content

Rust 1.40.0 nightly breaks specialization #614

@althonos

Description

@althonos

🐛 Bug Reports

When reporting a bug, please provide the following information. If this is not a bug report you can just discard this template.

🌍 Environment

  • Your operating system and version: ArchLinux
  • Your python version: Python 3.7
  • How did you install python (e.g. apt or pyenv)? Did you use a virtualenv?: pacman, no.
  • Your rust version (rustc --version): cargo 1.40.0-nightly (8b0561d68 2019-09-30)
  • Are you using the latest pyo3 version: using master

💥 Reproducing

Building using the latest nightly Rust compiler gives 89 errors caused by functions being specialized without having been marked as default:

error[E0520]: `drop_impl` specializes an item from a parent `impl`, but that item is not marked `default`
   --> src/instance.rs:595:5
    |
580 | impl<T: ToPyObject + ?Sized> ManagedPyRefDispatch for T {}
    | ---------------------------------------------------------- parent `impl` is here
...
595 |     fn drop_impl(_: &mut ManagedPyRef<T>) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `drop_impl`
    |
    = note: to specialize, `drop_impl` in the parent `impl` must be marked `default`

error: aborting due to 89 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions