Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests failing on rust 1.80.0 #4395

Closed
ngoldbaum opened this issue Jul 30, 2024 · 0 comments · Fixed by #4397
Closed

Tests failing on rust 1.80.0 #4395

ngoldbaum opened this issue Jul 30, 2024 · 0 comments · Fixed by #4397
Labels

Comments

@ngoldbaum
Copy link
Contributor

Bug Description

The test_compiler_errors are failing due to a recent upstream change in either zerocopy or because of the rust 1.80.0 release.

Steps to Reproduce

Run this in a clean checkout of pyo3:

cargo test --no-default-features --features "full" --test test_compile_error

On my mac, with rust 1.80.0 installed, this test fails.

Backtrace

There are two failed tests, but one of them has shorter output and it's easier to read what the difference is:


EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0277]: the trait bound `i32: TryFrom<BoundRef<'_, '_, MyClass>>` is not satisfied
 --> tests/ui/invalid_pymethod_receiver.rs:8:44
  |
8 |     fn method_with_invalid_self_type(_slf: i32, _py: Python<'_>, _index: u32) {}
  |                                            ^^^ the trait `From<BoundRef<'_, '_, MyClass>>` is not implemented for `i32`, which is required by `i32: TryFrom<BoundRef<'_, '_, MyClass>>`
  |
  = help: the following other types implement trait `From<T>`:
            <i32 as From<bool>>
            <i32 as From<i16>>
            <i32 as From<i8>>
            <i32 as From<u16>>
            <i32 as From<u8>>
  = note: required for `BoundRef<'_, '_, MyClass>` to implement `Into<i32>`
  = note: required for `i32` to implement `TryFrom<BoundRef<'_, '_, MyClass>>`
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0277]: the trait bound `i32: TryFrom<BoundRef<'_, '_, MyClass>>` is not satisfied
 --> tests/ui/invalid_pymethod_receiver.rs:8:44
  |
8 |     fn method_with_invalid_self_type(_slf: i32, _py: Python<'_>, _index: u32) {}
  |                                            ^^^ the trait `From<BoundRef<'_, '_, MyClass>>` is not implemented for `i32`, which is required by `i32: TryFrom<BoundRef<'_, '_, MyClass>>`
  |
  = help: the following other types implement trait `From<T>`:
            <i32 as From<bool>>
            <i32 as From<i16>>
            <i32 as From<i8>>
            <i32 as From<u16>>
            <i32 as From<u8>>
            <i32 as From<zerocopy::byteorder::I16<O>>>
            <i32 as From<zerocopy::byteorder::I32<O>>>
  = note: required for `BoundRef<'_, '_, MyClass>` to implement `Into<i32>`
  = note: required for `i32` to implement `TryFrom<BoundRef<'_, '_, MyClass>>`
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite


### Your operating system and version

MacOS Sonoma

### Your Python version (`python --version`)

3.12.3

### Your Rust version (`rustc --version`)

1.80.0

### Your PyO3 version

current `main` branch

### How did you install python? Did you use a virtualenv?

pyenv, no virtualenv

### Additional Info

_No response_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant