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

Error installing cargo-watch on M4 Mac #138922

Closed
thegreathir opened this issue Mar 25, 2025 · 6 comments
Closed

Error installing cargo-watch on M4 Mac #138922

thegreathir opened this issue Mar 25, 2025 · 6 comments
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues.

Comments

@thegreathir
Copy link

Command:

cargo install cargo-watch

Error:

error[E0283]: type annotations needed
  --> /Users/XXX/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/notify-rust-4.11.5/src/timeout.rs:50:51
   |
50 |         } else if duration.as_millis() > u32::MAX.into() {
   |                                        -          ^^^^
   |                                        |
   |                                        type must be known at this point
   |
   = note: multiple `impl`s satisfying `u128: PartialOrd<_>` found in the following crates: `core`, `deranged`:
           - impl PartialOrd for u128;
           - impl<MIN, MAX> PartialOrd<deranged::RangedU128<MIN, MAX>> for u128
             where the constant `MIN` has type `u128`, the constant `MAX` has type `u128`;
help: try using a fully qualified path to specify the expected types
   |
50 |         } else if duration.as_millis() > <u32 as Into<T>>::into(u32::MAX) {
   |                                          +++++++++++++++++++++++        ~


Compiler version:

➜  ~ rustc --version --verbose
rustc 1.85.1 (4eb161250 2025-03-15)
binary: rustc
commit-hash: 4eb161250e340c8f48f66e2b929ef4a5bed7c181
commit-date: 2025-03-15
host: aarch64-apple-darwin
release: 1.85.1
LLVM version: 19.1.7
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 25, 2025
@bjorn3
Copy link
Member

bjorn3 commented Mar 25, 2025

Does cargo install --locked cargo-watch work?

@thegreathir
Copy link
Author

Yes it solved,
It installed Compiling notify-rust v4.11.3

@bjorn3
Copy link
Member

bjorn3 commented Mar 25, 2025

In that case it is likely a dependency update that caused this. Given that this is an inference failure, it may not even be a semver breaking change according to the rust semver stability rules. In any case it is not something rustc can do anything about.

@bjorn3 bjorn3 added the C-discussion Category: Discussion or questions that doesn't represent real issues. label Mar 25, 2025
@thegreathir
Copy link
Author

OK, you can close this,
Should I go ahead and submit an issue on rust-notify repo?

@saethlin saethlin closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2025
@saethlin
Copy link
Member

You should check if cargo-watch already advises you to pass --locked to avoid this situation. Many projects do.

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 25, 2025
@thegreathir
Copy link
Author

Cargo watch seems archived unfortunately,
Probably I should keep in touch with Graphite to migrate to something else.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues.
Projects
None yet
Development

No branches or pull requests

4 participants