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

Running cargo test gives error after following instructions of post-04 #1259

Closed
tathyagarg opened this issue Jan 2, 2024 · 2 comments
Closed

Comments

@tathyagarg
Copy link

I've followed all the instructions so far, however, when I run cargo test I get the following error:

error[E0152]: duplicate lang item in crate `core` (which `rustc_std_workspace_core` depends on): `sized`.
  |
  = note: the lang item is first defined in crate `core` (which `volatile` depends on)
  = note: first definition in `core` loaded from my_directory\debug\deps\libcore-da969d849535039e.rmeta
  = note: second definition in `core` loaded from my_directory\debug\deps\libcore-b3bc9f2b6937c461.rmeta

error[E0152]: duplicate lang item in crate `core` (which `rustc_std_workspace_core` depends on): `unsize`.
  |
  = note: the lang item is first defined in crate `core` (which `volatile` depends on)
  = note: first definition in `core` loaded from my_directory\debug\deps\libcore-da969d849535039e.rmeta
  = note: second definition in `core` loaded from my_directory\debug\deps\libcore-b3bc9f2b6937c461.rmeta
...

error: could not compile 'bootloader' (lib) due to 128 previous errors
error: could not compile 'spin' (lib) due to 128 previous errors

Any ideas on what I may be doing wrong?

@acyanbird
Copy link
Contributor

Are you following the note in Custom Test Frameworks section?
Note: There is currently a bug in cargo that leads to “duplicate lang item” errors on cargo test in some cases. It occurs when you have set panic = "abort" for a profile in your Cargo.toml. Try removing it, then cargo test should work. See the cargo issue for more information on this.

@tathyagarg
Copy link
Author

That worked, thanks!

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