Skip to content

bevy_render 0.19.1 doesn't compile on current Rust nightly due to -Znext-solver enabled by default #25511

Closed
rust-lang/rust
#161552

Description

@futile

Workaround

tl;dr: Fixed since rustc nightly 2026-08-24.

old tl;dr: Use RUSTFLAGS=-Znext-solver=coherence or equivalent cargo config when compiling with rustc 1.100.0-nightly (c656540d6 2026-08-21) or newer.

Bevy version and features

  • Bevy version: 0.19.1
  • Enabled bevy features: I don't think these are relevant, because the bug has been confirmed in Discord by other ppl as well. So if it's only caused by certain features, they are probably very common ones.

Relevant system information

❯ cargo --version && rustc --version
cargo 1.100.0-nightly (514c56dd7 2026-08-19)
rustc 1.100.0-nightly (c656540d6 2026-08-21)
❯ uname -a
Linux nixos-work 6.18.44 #1-NixOS SMP PREEMPT_DYNAMIC Sun Aug  9 18:25:30 UTC 2026 x86_64 GNU/Linux

What you did

Built a project that has a bevy 0.19.1 dependency using cargo build.

What went wrong

Compilation fails with:

error[E0034]: multiple applicable items in scope
    --> /home/felix/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_render-0.19.1/src/render_phase/mod.rs:1532:30
     |
1532 | ...   .run_if(resource_exists::<BatchedInstanceBuffer<GFBD::BufferData...
     |        ^^^^^^ multiple `run_if` found
     |
     = note: candidate #1 is defined in an impl of the trait `bevy_ecs::schedule::IntoScheduleConfigs` for the type `F`
     = note: candidate #2 is defined in an impl of the trait `bevy_ecs::observer::ObserverSystemExt` for the type `T`
help: disambiguate the method for candidate #1
     |
1531 -                         no_gpu_preprocessing::batch_and_prepare_binned_render_phase::<BPI, GFBD>
1532 -                             .run_if(resource_exists::<BatchedInstanceBuffer<GFBD::BufferData>>),
1531 +                         bevy_ecs::schedule::IntoScheduleConfigs::run_if(no_gpu_preprocessing::batch_and_prepare_binned_render_phase::<BPI, GFBD>, resource_exists::<BatchedInstanceBuffer<GFBD::BufferData>>),
     |
help: disambiguate the method for candidate #2
     |
1531 -                         no_gpu_preprocessing::batch_and_prepare_binned_render_phase::<BPI, GFBD>
1532 -                             .run_if(resource_exists::<BatchedInstanceBuffer<GFBD::BufferData>>),
1531 +                         bevy_ecs::observer::ObserverSystemExt::run_if(no_gpu_preprocessing::batch_and_prepare_binned_render_phase::<BPI, GFBD>, resource_exists::<BatchedInstanceBuffer<GFBD::BufferData>>),
     |

    Building [=======================> ] 541/563: bevy_light, bevy_picking, b…
error[E0034]: multiple applicable items in scope
    --> /home/felix/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_render-0.19.1/src/render_phase/mod.rs:1534:30
     |
1534 | ...                   .run_if(
     |                        ^^^^^^ multiple `run_if` found
     |
     = note: candidate #1 is defined in an impl of the trait `bevy_ecs::schedule::IntoScheduleConfigs` for the type `F`
     = note: candidate #2 is defined in an impl of the trait `bevy_ecs::observer::ObserverSystemExt` for the type `T`
help: disambiguate the method for candidate #1
     |
1533 ~                         bevy_ecs::schedule::IntoScheduleConfigs::run_if(gpu_preprocessing::batch_and_prepare_binned_render_phase::<BPI, GFBD>, resource_exists::<
1534 +                                     BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>,
1535 ~                                 >),
     |
help: disambiguate the method for candidate #2
     |
1533 ~                         bevy_ecs::observer::ObserverSystemExt::run_if(gpu_preprocessing::batch_and_prepare_binned_render_phase::<BPI, GFBD>, resource_exists::<
1534 +                                     BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>,
1535 ~                                 >),
     |

    Building [=======================> ] 541/563: bevy_light, bevy_picking, b…
error[E0034]: multiple applicable items in scope
    --> /home/felix/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_render-0.19.1/src/render_phase/mod.rs:1543:26
     |
1543 |                         .run_if(
     |                          ^^^^^^ multiple `run_if` found
     |
     = note: candidate #1 is defined in an impl of the trait `bevy_ecs::schedule::IntoScheduleConfigs` for the type `F`
     = note: candidate #2 is defined in an impl of the trait `bevy_ecs::observer::ObserverSystemExt` for the type `T`
help: disambiguate the method for candidate #1
     |
1542 ~                     bevy_ecs::schedule::IntoScheduleConfigs::run_if(gpu_preprocessing::write_binned_instance_buffers::<BPI, GFBD>, resource_exists::<
1543 +                                 BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>,
1544 +                             >)
     |
help: disambiguate the method for candidate #2
     |
1542 ~                     bevy_ecs::observer::ObserverSystemExt::run_if(gpu_preprocessing::write_binned_instance_buffers::<BPI, GFBD>, resource_exists::<
1543 +                                 BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>,
1544 +                             >)
     |

    Building [=======================> ] 541/563: bevy_light, bevy_picking, b…
error[E0034]: multiple applicable items in scope
    --> /home/felix/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_render-0.19.1/src/render_phase/mod.rs:1551:26
     |
1551 |                         .run_if(
     |                          ^^^^^^ multiple `run_if` found
     |
     = note: candidate #1 is defined in an impl of the trait `bevy_ecs::schedule::IntoScheduleConfigs` for the type `F`
     = note: candidate #2 is defined in an impl of the trait `bevy_ecs::observer::ObserverSystemExt` for the type `T`
help: disambiguate the method for candidate #1
     |
1550 ~                     bevy_ecs::schedule::IntoScheduleConfigs::run_if(gpu_preprocessing::collect_buffers_for_phase::<BPI, GFBD>, resource_exists::<
1551 +                                 BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>,
1552 +                             >)
     |
help: disambiguate the method for candidate #2
     |
1550 ~                     bevy_ecs::observer::ObserverSystemExt::run_if(gpu_preprocessing::collect_buffers_for_phase::<BPI, GFBD>, resource_exists::<
1551 +                                 BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>,
1552 +                             >)
     |

    Building [=======================> ] 541/563: bevy_light, bevy_picking, b…
error[E0034]: multiple applicable items in scope
    --> /home/felix/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_render-0.19.1/src/render_phase/mod.rs:1652:30
     |
1652 | ...   .run_if(resource_exists::<BatchedInstanceBuffer<GFBD::BufferData...
     |        ^^^^^^ multiple `run_if` found
     |
     = note: candidate #1 is defined in an impl of the trait `bevy_ecs::schedule::IntoScheduleConfigs` for the type `F`
     = note: candidate #2 is defined in an impl of the trait `bevy_ecs::observer::ObserverSystemExt` for the type `T`
help: disambiguate the method for candidate #1
     |
1651 -                         no_gpu_preprocessing::batch_and_prepare_sorted_render_phase::<SPI, GFBD>
1652 -                             .run_if(resource_exists::<BatchedInstanceBuffer<GFBD::BufferData>>),
1651 +                         bevy_ecs::schedule::IntoScheduleConfigs::run_if(no_gpu_preprocessing::batch_and_prepare_sorted_render_phase::<SPI, GFBD>, resource_exists::<BatchedInstanceBuffer<GFBD::BufferData>>),
     |
help: disambiguate the method for candidate #2
     |
1651 -                         no_gpu_preprocessing::batch_and_prepare_sorted_render_phase::<SPI, GFBD>
1652 -                             .run_if(resource_exists::<BatchedInstanceBuffer<GFBD::BufferData>>),
1651 +                         bevy_ecs::observer::ObserverSystemExt::run_if(no_gpu_preprocessing::batch_and_prepare_sorted_render_phase::<SPI, GFBD>, resource_exists::<BatchedInstanceBuffer<GFBD::BufferData>>),
     |

    Building [=======================> ] 541/563: bevy_light, bevy_picking, b…
error[E0034]: multiple applicable items in scope
    --> /home/felix/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_render-0.19.1/src/render_phase/mod.rs:1654:30
     |
1654 | ...                   .run_if(
     |                        ^^^^^^ multiple `run_if` found
     |
     = note: candidate #1 is defined in an impl of the trait `bevy_ecs::schedule::IntoScheduleConfigs` for the type `F`
     = note: candidate #2 is defined in an impl of the trait `bevy_ecs::observer::ObserverSystemExt` for the type `T`
help: disambiguate the method for candidate #1
     |
1653 ~                         bevy_ecs::schedule::IntoScheduleConfigs::run_if(gpu_preprocessing::batch_and_prepare_sorted_render_phase::<SPI, GFBD>, resource_exists::<
1654 +                                     BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>,
1655 ~                                 >),
     |
help: disambiguate the method for candidate #2
     |
1653 ~                         bevy_ecs::observer::ObserverSystemExt::run_if(gpu_preprocessing::batch_and_prepare_sorted_render_phase::<SPI, GFBD>, resource_exists::<
1654 +                                     BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>,
1655 ~                                 >),
     |

    Building [=======================> ] 541/563: bevy_light, bevy_picking, b…
error[E0034]: multiple applicable items in scope
    --> /home/felix/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_render-0.19.1/src/render_phase/mod.rs:1662:26
     |
1662 |                         .run_if(
     |                          ^^^^^^ multiple `run_if` found
     |
     = note: candidate #1 is defined in an impl of the trait `bevy_ecs::schedule::IntoScheduleConfigs` for the type `F`
     = note: candidate #2 is defined in an impl of the trait `bevy_ecs::observer::ObserverSystemExt` for the type `T`
help: disambiguate the method for candidate #1
     |
1661 ~                     bevy_ecs::schedule::IntoScheduleConfigs::run_if(gpu_preprocessing::collect_buffers_for_phase::<SPI, GFBD>, resource_exists::<
1662 +                                 BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>,
1663 +                             >)
     |
help: disambiguate the method for candidate #2
     |
1661 ~                     bevy_ecs::observer::ObserverSystemExt::run_if(gpu_preprocessing::collect_buffers_for_phase::<SPI, GFBD>, resource_exists::<
1662 +                                 BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>,
1663 +                             >)
     |

    Building [=======================> ] 541/563: bevy_light, bevy_picking, b…
error[E0034]: multiple applicable items in scope
  --> /home/felix/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_render-0.19.1/src/view/window/mod.rs:42:26
   |
42 |                         .run_if(need_surface_configuration)
   |                          ^^^^^^ multiple `run_if` found
   |
   = note: candidate #1 is defined in an impl of the trait `bevy_ecs::schedule::IntoScheduleConfigs` for the type `F`
   = note: candidate #2 is defined in an impl of the trait `bevy_ecs::observer::ObserverSystemExt` for the type `T`
help: disambiguate the method for candidate #1
   |
41 -                     create_surfaces
42 -                         .run_if(need_surface_configuration)
41 +                     bevy_ecs::schedule::IntoScheduleConfigs::run_if(create_surfaces, need_surface_configuration)
   |
help: disambiguate the method for candidate #2
   |
41 -                     create_surfaces
42 -                         .run_if(need_surface_configuration)
41 +                     bevy_ecs::observer::ObserverSystemExt::run_if(create_surfaces, need_surface_configuration)
   |

Additional information

Activity

  1. added
    C-Bug
    S-Needs-Triage
    on Aug 22, 2026
  2. changed the title [-]bevy_render 0.19.1 doesn't compile with next-solver[/-] [+]bevy_render 0.19.1 doesn't compile on current Rust nightly due to next-solver enabled by default[/+] on Aug 22, 2026
  3. changed the title [-]bevy_render 0.19.1 doesn't compile on current Rust nightly due to next-solver enabled by default[/-] [+]bevy_render 0.19.1 doesn't compile on current Rust nightly due to `-Znext-solver` enabled by default[/+] on Aug 22, 2026
  4. added
    S-Blocked
    I-Compile-Failure
    S-Needs-Investigation
    and removed
    S-Needs-Triage
    on Aug 22, 2026
  5. laundmo commented on Aug 22, 2026

    @laundmo
    Contributor

    I'm investigating this, to hopefully find a small reproduction so we can know if its one of the intended breakages and we need to do something or its an issue with next-solver.

    Until then, i'm going to leave "Blocked" as a label

  6. laundmo commented on Aug 22, 2026

    @laundmo
    Contributor

    Okay, it seems to be that the reported error is not actually whats going wrong, and instead is a symptom of the underlying error: bevy_render regularily exceeds the rustc type resolution recurision limit, which has been turned into a warning, which for some reason means its hidden when compiling as a dependency

  7. lcnr commented on Aug 22, 2026

    @lcnr
    Contributor

    is that fixed by rust-lang/rust#161341?

  8. lcnr commented on Aug 22, 2026

    @lcnr
    Contributor

    (testing it myself rn and will try to fast-track that PR if it's the issue)

  9. futile commented on Aug 22, 2026

    @futile
    ContributorAuthor

    is that fixed by rust-lang/rust#161341?

    Investigation/discussion is also happening here currently (bevy discord), incl. someone else also testing out the PR you linked: https://discord.com/channels/691052431525675048/1540728195341623316

  10. lcnr commented on Aug 22, 2026

    @lcnr
    Contributor

    this will be fixed by rust-lang/rust#161552

  11. futile commented on Aug 22, 2026

    @futile
    ContributorAuthor

    this will be fixed by rust-lang/rust#161552

    To be clear - will this fix the actual error or surface the underlying overflow that's currently being hidden?

    If I understand correctly, rust-lang/rust#161552 will make the overflow show up that is currently not being warned/errored about by rustc.
    The compilation error in my OP post will (independently) need fixing by, e.g., introducing intermediary (auto) trait impls to prevent the underlying overflow from occurring?

    Thanks already for helping investigate this <3

  12. 1 remaining item

  13. futile commented on Aug 22, 2026

    @futile
    ContributorAuthor

    Ohh got it, awesome, ty! Now it all makes sense as well :)

  14. added 2 commits that reference this issue on Aug 24, 2026
  15. added a commit that references this issue on Aug 24, 2026
  16. futile commented on Aug 25, 2026

    @futile
    ContributorAuthor

    Tested and confirmed solved with the 2026-08-24 nightly! :)

  17. analytik commented on Aug 26, 2026

    @analytik

    Not sure if this is the right place to report this (cross-posting from rust-lang/rust#161552 just in case anyone looks for it here), but bevy_render, while compiling correctly with the new trait solver, also takes 3700 seconds with it, and 100 seconds with the old one.

    Using rustc 1.100.0-nightly (787af2b8c 2026-08-25) on both host+target x86_64-pc-windows-msvc, with bevy's feature dynamic_linking turned on.

  18. laundmo commented on Aug 26, 2026

    @laundmo
    Contributor

    I'm relatively sure neither here or the linked rust issue are the correct place to report this. For bevy, it'd be a new issue, since this likely is separate from specifically the overflow, and for rust it'd proably also be a new issue if its a previously unknown issue or a comment in the next-solver enabled by default issues

  19. lcnr commented on Aug 27, 2026

    @lcnr
    Contributor

    This is likely due to rust-lang/rust#161748. We're (the people working on the new trait solver) are currently looking into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-BugI-Compile-FailureS-BlockedS-Needs-Investigation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions