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

Build fail on the nightly version of rust when compiling obj2 #8155

Closed
Parallel-Paradox opened this issue Mar 22, 2023 · 5 comments
Closed
Labels
C-Bug An unexpected or incorrect behavior P-Compile-Failure A failure to compile Bevy apps

Comments

@Parallel-Paradox
Copy link

Bevy version

0.10

[Optional] Relevant system information

What you did

cargo build

What went wrong

error[E0277]: `<<I as IvarType>::Type as InnerIvarType>::Output` is not an iterator
   --> /Users/bytedance/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-0.3.0-beta.3.patch-leaks.2/src/declare/ivar_forwarding_impls.rs:165:5
    |
165 |     fn nth(&mut self, n: usize) -> Option<<<Self as Deref>::Target as Iterator>::Item> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<I as IvarType>::Type as InnerIvarType>::Output` is not an iterator
    |
    = help: the trait `Iterator` is not implemented for `<<I as IvarType>::Type as InnerIvarType>::Output`
note: required for `ivar::Ivar<I>` to implement `Iterator`
   --> /Users/bytedance/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-0.3.0-beta.3.patch-leaks.2/src/declare/ivar_forwarding_impls.rs:154:19
    |
154 | impl<I: IvarType> Iterator for Ivar<I>
    |                   ^^^^^^^^     ^^^^^^^
155 | where
156 |     <Self as Deref>::Target: Iterator,
    |                              -------- unsatisfied trait bound introduced here
help: consider further restricting the associated type
    |
165 |     fn nth(&mut self, n: usize) -> Option<<<Self as Deref>::Target as Iterator>::Item> where <<I as IvarType>::Type as InnerIvarType>::Output: Iterator {
    |                                                                                        ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: `<<I as IvarType>::Type as InnerIvarType>::Output` is not an iterator
   --> /Users/bytedance/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-0.3.0-beta.3.patch-leaks.2/src/declare/ivar_forwarding_impls.rs:165:5
    |
165 |     fn nth(&mut self, n: usize) -> Option<<<Self as Deref>::Target as Iterator>::Item> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<I as IvarType>::Type as InnerIvarType>::Output` is not an iterator
    |
    = help: the trait `Iterator` is not implemented for `<<I as IvarType>::Type as InnerIvarType>::Output`
help: consider further restricting the associated type
    |
165 |     fn nth(&mut self, n: usize) -> Option<<<Self as Deref>::Target as Iterator>::Item> where <<I as IvarType>::Type as InnerIvarType>::Output: Iterator {
    |                                                                                        ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

   Compiling approx v0.5.1
   Compiling slotmap v1.0.6
   Compiling mach v0.3.2
   Compiling tinyvec_macros v0.1.1
   Compiling ryu v1.0.13
For more information about this error, try `rustc --explain E0277`.
error: could not compile `objc2` (lib) due to 2 previous errors
@Parallel-Paradox Parallel-Paradox added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Mar 22, 2023
@Parallel-Paradox
Copy link
Author

Parallel-Paradox commented Mar 22, 2023

Switch to stable channel fix this, while close Z-generic in nightly channel doesn't. Using Mac.

@Parallel-Paradox
Copy link
Author

Wondering if there are any other guys come across this. Looks like not a bevy issue but don't know whom I should raise it to.

@james7132
Copy link
Member

We really only support compiling against the latest stable Rust. We, and our dependencies, cannot accomodate every possible breaking change that is enabled in nightly, and will address these breakages only when they're stabilized.

@james7132 james7132 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2023
@james7132 james7132 added P-Compile-Failure A failure to compile Bevy apps and removed S-Needs-Triage This issue needs to be labelled labels Mar 22, 2023
@turboladen
Copy link

We really only support compiling against the latest stable Rust.

@james7132 I'm not contesting your statement about only being able to support stable rust--that is 100% reasonable; the Bevy Getting Started docs, on the other hand, sure make it seem like I'm encouraged to use nightly:

Nightly Rust Compiler: This gives access to the latest performance improvements and "unstable" optimizations

and:

Generic Sharing: Allows crates to share monomorphized generic code instead of duplicating it. In some cases this allows us to "precompile" generic code so it doesn't affect iterative compiles. This is only available on nightly Rust.

and the most tantalizing:

To enable fast compiles, install the nightly rust compiler and LLD. Then copy the contents of this file to YOUR_WORKSPACE/.cargo/config.toml.

If nightly really isn't supported, it seems like that should be made clearer in those sections ^^; i.e. "You're welcome to try out nightly as you might see benefits, but there are no guarantees bevy will compile and, depending on the issue, your problems may not be something the bevy team is able to resolve. tl;dr YMMV."

Again, the stance is totally reasonable--for my part, it would've been nice to realize that using nightly was a gamble while going through the setup docs instead of having to google for my compiler failure and hoping I wasn't the only one encountering the problem. To me, the docs imply that using nightly should just work ™️.

@mockersf
Copy link
Member

mockersf commented Mar 28, 2023

Rust nightly should just work. Most of the time, they add some new lints that are not immediately followed in our code, but that's not an issue for using it except when running clippy on Bevy repo.

There is the rare case of a bug in Rust nightly, which is the case here: rust-lang/rust#109632

There are no reasons outside of a bug or a breaking change (which is very very rare, I think I can remember 2 cases in 6 years) in Rust that it would stop working. What is meant by "no support" is that we won't investigate on Bevy side, and won't guarantee that the latest nightly always work. It works, except when there's a bug, and that's up to users to discover them. In that case, using nightly from before the bug should allow you to continue using nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug An unexpected or incorrect behavior P-Compile-Failure A failure to compile Bevy apps
Projects
None yet
Development

No branches or pull requests

4 participants