dtolnay / thiserror

derive(Error) for struct and enum error types
Apache License 2.0
4.5k stars 160 forks source link

New release breaks callers of the Error derive if it came from a re-export from another crate #241

Closed NiseVoid closed 1 year ago

NiseVoid commented 1 year ago

Hello, the new release of thiserror seems to have broken something. A game engine called bevy re-exports thiserror in a bevy_utils crate, when the code is then called in other places it fails to compile on the newest release because it calls thiserror::__private when the path it is available at would be bevy_utils::thiserror::_private. This results in compilation errors, for example this CI run: https://github.com/Jondolf/bevy_xpbd/actions/runs/5481101314/jobs/9985014733#step:4:293 I'm not quite sure what the correct solution here is, but I think calling the macros from a re-export is a valid usecase that should work as intended

NiseVoid commented 1 year ago

The relevant line of code that's hitting the error: https://github.com/bevyengine/bevy/blob/v0.10.1/crates/bevy_ecs/src/schedule/schedule.rs#L1582

As you can see, nothing too strange here, just a derive Error. But it comes from bevy_utils::thiserror::Error, so there is no thiserror in scope

dtolnay commented 1 year ago

Fixed in 1.0.43.