madsmtm / objc2

Bindings to Apple's frameworks in Rust
https://docs.rs/objc2/
MIT License
290 stars 35 forks source link

Failure to compile on Rust nightly 1.70.0 #432

Closed janhohenheim closed 1 year ago

janhohenheim commented 1 year ago

I'm not using this crate at all, but it is a transient dependency of mine and I recently got a CI failure. It seems like objc2-0.3.0-beta.3.patch-leaks.2 fails to compile on Rust nightly 1.70.0, but compiles on nightly 1.69.0.

madsmtm commented 1 year ago

Thank you for the report! I've verified that it is present on master as well.

It seems more like a std or rustc bug though? The bounds on our Iterator impl should be completely fine, but it now fails due to the Self::Item: ~const Destruct bound on fn nth added in https://github.com/rust-lang/rust/pull/104100.

I'll probably submit a regression report upstream in the next few days (if you don't do it first?).

janhohenheim commented 1 year ago

Since you actually know about the soundness of your code, I'd be glad if you could submit it 🙂

fee1-dead commented 1 year ago

I'm not sure if the ~const Destruct bound is the culprit, since it should have no effect on code that are not using const trait bounds.

kchibisov commented 1 year ago

@fee1-dead be aware that the main issue here that it's a regression from stable to nightly since the latest stable builds this code just fine.

I could submit bug report as well though, but I'm not a maintainer of this crate, and not sure I can clearly express the issue other than saying that code was fine on stable for like near a year.

fee1-dead commented 1 year ago

I wasn't denying that the regression exists. I was mainly coming from a rustc maintainer perspective since I approved the linked PR above. To find the actual change that caused this would involve cargo-bisect-rustc. I don't have time to run that right now, but opening a rust-lang/rust issue would help as well.

kchibisov commented 1 year ago

Opened upstream ticket https://github.com/rust-lang/rust/issues/109632

madsmtm commented 1 year ago

I'd like to wait and see what happens upstream, since it is a rustc bug, but if the issue persists for let's say ~5 days more, I'll push a patched objc2 version to deal with it regardless

madsmtm commented 1 year ago

Update: I've created a new version 0.3.0-beta.3.patch-leaks.3, so affected nightly users should simply be able to do a cargo update to fix the issue for them.

@fee1-dead created https://github.com/rust-lang/rust/pull/109684, so I suspect that the issue will be fixed properly soon - I will keep this issue open until that happens.

madsmtm commented 1 year ago

This has been fixed in std now, thanks to @fee1-dead for their work in doing so!