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

cargo +nightly run --example bouncing_balls -> no method is_older_than #3

Closed
stnbu opened this issue Feb 9, 2023 · 5 comments
Closed

Comments

@stnbu
Copy link

stnbu commented Feb 9, 2023

Hi. I was excited to see your crate. I'm trying to rearchitect some things so that I can use an enum to maintain the "state" of an entity, which you can do currently but at the cost of an additional indention level and a small efficiency hit.

...anyway.

I tried to run cargo +nightly run --example bouncing_balls Everything resolved and compiled fine, but when I got to bevy_mod_index I got the following from rustc:

error[E0599]: no method named `is_older_than` found for struct `Tick` in the current scope
  --> src/index.rs:58:18
   |
58 |                 .is_older_than(component.last_changed(), self.current_tick)
   |                  ^^^^^^^^^^^^^ help: there is a method with a similar name: `is_newer_than`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `bevy_mod_index` due to previous error
yolo:bevy_mod_index mburr$ cargo +nightly run --example bouncing_balls
   Compiling bevy_mod_index v0.1.0 (/Users/mburr/git/bevy_mod_index)
error[E0599]: no method named `is_older_than` found for struct `Tick` in the current scope
  --> src/index.rs:58:18
   |
58 |                 .is_older_than(component.last_changed(), self.current_tick)
   |                  ^^^^^^^^^^^^^ help: there is a method with a similar name: `is_newer_than`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `bevy_mod_index` due to previous error

This is with nightly-x86_64-apple-darwin which for me is rustc 1.66.1 (90743e729 2023-01-10).

I did patch ChangeTrackers as indicated. I did this by modifying ~/.cargo/git/checkouts, which I believe works (if a bad practice.)

I think this error occurs before any of that.

BTW... I wonder if instead of patching the source, a so-called "extension trait" could be used.

@chrisjuchem
Copy link
Owner

The bevy main branch was just updated today with this PR that I had submitted to clarify the behavior of that method.

With that and the other pr mentioned in #2, the custom patch is actually no longer necessary. I plan to merge that and update the readme later on today when I have the time.

For now, checkout the tick_fix branch I'm using in that PR, it should work against bevy main.

@chrisjuchem
Copy link
Owner

Also, the extension trait would not have worked because the field I wanted to return was marked pub(crate).

@stnbu
Copy link
Author

stnbu commented Feb 9, 2023

Cool. Thanks for the snappy response(s). That all sounds like nice, rapid progress. I know how it goes! Feel free to close.

@stnbu
Copy link
Author

stnbu commented Feb 9, 2023

For now, checkout the tick_fix branch

tick_fix worked. Nice demo.

@chrisjuchem
Copy link
Owner

#2 was merged, bevy_mod_index/main should now work with bevy/main.

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

No branches or pull requests

2 participants