#Rustrover error but still compiles?

6 messages · Page 1 of 1 (latest)

jovial grove
#

Hi Im going through the quick start on https://bevyengine.org/learn/quick-start/getting-started/ecs/
I have copied the

fn add_people(mut commands: Commands) {
    commands.spawn((Person, Name("Elaina Proctor".to_string())));
    commands.spawn((Person, Name("Renzo Hume".to_string())));
    commands.spawn((Person, Name("Zayna Nieves".to_string())));
}

function into rustrover and while it compiles just fine its strangely giving the Trait Component is not implemented for (Person, Name)error on the first one only
https://i.imgur.com/WlRaAyw.png
there is definitely something funny going on environment wise and there is nothing on google about it, so i was wondering if anyone here had a similar issue/fix

full main.rs file just in case

use bevy::prelude::*;
fn main() {
    App::new()
        .add_systems(Startup, add_people)
        .run();
}
fn add_people(mut commands: Commands){
    commands.spawn((Person, Name("Elaina Proctor".to_string())));
    commands.spawn((Person, Name("Renzo Hume".to_string())));
    commands.spawn((Person, Name("Zayna Nieves".to_string())));
}
#[derive(Component)]
struct Person;

#[derive(Component)]
struct Name(String);
silver rose
#

I had this issue with VsCode so I moved to RustRover and I have no loger this issue.

severe cairn
#

It's weird because it should say Bundle is not implemented for it to make any sense. On the side now, Bevy does have its own Name component so I wonder which one is being used in this case, given it's in prelude and your own Name is define below the add_people. Would you mind checking(hover over it to see struct path), I'm curious 🙂

orchid rivet
#

Have you refreshed cargo or reloaded the project?

jovial grove
#

So I did end up restarting the project and reloading everything and it did not fix it

#

but obviously restarting my pc the next morning fixed everything lmfao