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

I'm facing this error during compile for linux: type annotations needed for Box<_> #12264

Closed
1 task done
shahverd opened this issue May 25, 2024 · 10 comments
Closed
1 task done
Labels
bug [core label] linux open source Open source community projects, contributions, etc

Comments

@shahverd
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

    Compiling time v0.3.28
error[E0282]: type annotations needed for `Box<_>`
  --> /home/mostafa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.28/src/format_description/parse/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
help: consider giving `items` an explicit type, where the placeholders `_` are specified
   |
83 |     let items: Box<_> = format_items
   |              ++++++++

For more information about this error, try `rustc --explain E0282`.
error: could not compile `time` (lib) due to 1 previous error

Environment

I don't know the alternative for copy system specs into clipboard on linux.

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@shahverd shahverd added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels May 25, 2024
@shahverd shahverd changed the title I'm facing this error during compile for linux: consider giving items an explicit type, where the placeholders _ are specified I'm facing this error during compile for linux: type annotations needed for Box<_> May 25, 2024
@SomeoneToIgnore
Copy link
Contributor

What's your rustc version, does it match

channel = "1.78"
?

@SomeoneToIgnore
Copy link
Contributor

SomeoneToIgnore commented May 25, 2024

Also note that you cannot compile a dependency crate, not Zed per se, so not really related to Zed.

@shahverd
Copy link
Author

shahverd commented May 25, 2024

my rustc version is as above. Also I have tried 1.80

@SomeoneToIgnore
Copy link
Contributor

Our Linux CI shows that building is possible on a daily basis, people seem to have no compliation issues related to Rust, and also my local tests on a clean VM show the same:
Screenshot 2024-05-26 at 00 27 44

So, closing this optimistically as something broken with the local set-up.

I see 2 possibilities:

  • zed project directory has some rustc overrides or otherwise the toolchain version is not the same.
    I would try running cargo --version to ensure things are working.

  • The crate source code could've been edited or anyhow else damaged.
    I would remove /home/mostafa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.28/ and try to recompile.

Maybe, there's something else is off, but I cannot deduce that from such sparse details.

@SomeoneToIgnore SomeoneToIgnore closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2024
@Moshyfawn Moshyfawn added linux and removed triage Maintainer needs to classify the issue labels May 26, 2024
@JosephTLyons JosephTLyons added open source Open source community projects, contributions, etc and removed admin read Pending admin review labels May 28, 2024
@fala13
Copy link

fala13 commented Jul 28, 2024

Had the exact same compilation issue on different project - deleting Cargo.lock solved it.

@jonmayer
Copy link

jonmayer commented Jul 30, 2024

I am seeing the exact same failure with time-0.3.28 -- I'm running on stable (rustc/cargo version 1.80.0, but on ARM architecture (stable-aarch64-unknown-linux-gnu). (I don't see why deleting Cargo.lock would make a difference but I'll try it and report back.)

@jonmayer
Copy link

Ah, I see the error is being tracked in the time-rs project: time-rs/time#696

Looks like they have a fix (as of 18 hours ago).

@BassManFH
Copy link

Same here, cargo update resolved the issue, although time-rs wasn't updated.

@AliBigdeli0
Copy link

Same here, cargo update resolved the issue, although time-rs wasn't updated.

I just used cargo update and it solved my problem.

@kevin-valerio
Copy link

For other folks coming here in the future, I had this issue by doing cargo install mydependency --locked, removing the --locked made it worked :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] linux open source Open source community projects, contributions, etc
Projects
None yet
Development

No branches or pull requests

9 participants