version of latest hyper seems to be broken

The following error happens on a brand new cargo project after running cargo add hyper && cargo check
Any ideas what might be going on ?

    Checking hyper v0.14.18
error[E0596]: cannot borrow `self.data_tx` as mutable, as `self` is not declared as mutable
   --> /Users/nikos/.cargo/registry/src/
656 |       pub fn abort(self)
    |                    ---- help: consider changing this to be mutable: `mut self`
657 |       {
658 |           let _ = self
    |  _________________^
659 | |             .data_tx
660 | |             // clone so the send works even if buffer is full
661 | |             .try_send(Err(crate::Error::new_body_write_aborted()));
    | |__________________________________________________________________^ cannot borrow as mutable

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

Strange, I tried to reproduce it, I also got hyper v0.14.18, but for me it compiled just fine.

I am using rust 1.61.0, which version are you using? Maybe you are using an older compiler and hyper did something that isn't backwards compatible?

im using 1.61 too so the only thing remains seem to be the platform. Are you using x86 or arm64 compiler.

PS. Cross compilation also doesnt seem to solve issue

I'm on x86_64 linux (Fedora 36). So if you are using arm, that might be it.

Another possiblity may be if your ~/.cargo/registry is messed up (either by doing something by hand, by a bug in cargo or something fishy in the file system¹). I think the "registry" directory is only cache of things that cargo downloads autmatically, so you could try removing that and building again?

  1. Or a combination, such that something in cargo don't work well with macos path names beeing only partially case-sensitive.

cleared the registry still same issue however hyper .13 compiles just fine

Strange. I tried looking at ~/.cargo/registry/src/ on my machine, and line 658 doesn't look anything like the error message says. There is a pub fn abort in my file that looks like the error message, but that is on line 605 (and my compiler doesn't complain about it).

So I would say there is an issue with your "registry". But you said you cleared it and the problem persists. So I don't know what is going on here. Maybe someone who knows more about cargo can help?

1 Like

earlier deleted just hyper specific stuff now deleted the entire registry folder and in fact things seem to be working now @kaj thanks for the assistance

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.