Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tried some programs that used to work:

First program:

    src/main.rs:65:11: 65:19 error: no method named `join` found for type `collections::vec::Vec<&str>` in the current scope
    src/main.rs:65     sline.join("")                              // return string
OK, what happened to ".join", and who had the great idea of taking it out?

Second program:

    $ cargo build
    An unknown error occurred

    To learn more, run the command again with --verbose.
OK, must rerun because of useless message.

    $ cargo --verbose build
    Invalid arguments.

    Usage:
        cargo <command> [<args>...]
        cargo [options]
Note that the "Usage" message doesn't say where to put the options if there's a commmand. So we have to guess:

    $ cargo build --verbose
    Failed to parse registry's information for: chrono

    Caused by:
      the given version requirement is invalid
The version requirement in the cargo.toml file under [dependencies] is

    chrono="*"
which, according to this manual [1] is valid.

I used to like Rust, but after years of stuff breaking with each new release, I don't use it for anything serious.

[1] http://doc.crates.io/specifying-dependencies.html



Rust has not removed an API since 1.0. Your code is extremely old and predates stability.

Yes, star dependencies were removed like a year ago, for semver issues. They went through multiple release cycles of warnings.


Rust has not removed an API since 1.0. Your code is extremely old and predates stability.

That code worked through at least Rust 1.2. So, yes, Rust has removed an API since 1.0. That code was compiling in December 2016.

Yes, star dependencies were removed like a year ago, for semver issues. They went through multiple release cycles of warnings.

From the Cargo manual [1]:

    Wildcard requirements

    Wildcard requirements allow for any version where the wildcard is positioned.

    *, 1.* and 1.2.* are examples of wildcard requirements.

    * := >=0.0.0
    1.* := >=1.0.0 <2.0.0
    1.2.* := >=1.2.0 <1.3.0
Apparently, nobody bothered to update the manual after removing the feature.

[1] http://doc.crates.io/specifying-dependencies.html


TL;DR Animats's errors were attempting to compile code from a more recent version of Rust on 1.2, or something similar. When I attempted to reproduce, I got the same errors on 1.2, and no errors on 1.17. Rust does not guarantee forward compatibility, code that compiles on 1.17 will not necessarily compile on 1.2 (of course, that would mean no new features).

I attempted to reproduce your report by downloading the 1.2 compiler and compiling this code in both versions. Here is what I got:

---

First, the Vec.join report. I attempted to compile a crate with this body on both versions:

    fn main() {
        let v: Vec<&str> = vec!["hello, ", "world"];
        v.join("");
    }
On 1.2 this failed to compile with exactly the error you stated. This isn't surprising to me since I recall us adding .join to Vec several months after the 1.2 release. So you certainly weren't compiling that code on 1.2.

In contrast, on 1.17, this code compiled just fine. This is exactly what I expected, since I use vec.join all the time on vectors of string slices.

In conclusion, I was unable to reproduce this bug.

---

Second, the Cargo star dependencies report. Manishearth is wrong, we disallow those dependencies from being uploaded to crates.io, but end users are allowed to use them just fine (strongly recommended that you don't, though!).

To attempt to reproduce, I built a crate with this dependencies section:

    [dependencies]
    chrono="*"
On 1.2, I got exactly the error you stated. I don't know what the source of it is, but I know that star dependencies are risky because they imply indefinite forward compatibility, which is impossible to guarantee.

On 1.17, this successfully resolved to the 0.3.0 version of chrono, which compiled just fine.

Once again, I was unable to reproduce your bug report.

---

If you have any more bug reports, please post them on https://github.com/rust-lang/rust . And you can check which version of the compiler you're using with `rustc --version` (supported since before 1.0).


To be clear, you can use star dependencies locally, but pushing a new crate to `crates.io` will reject crates that have star dependencies. So in some senses this is still accurate, but it's missing the crates.io interaction.

This means I don't understand how you got your error. For example:

  > cat .\Cargo.toml
  [package]
  name = "star"
  version = "0.1.0"
  authors = ["steveklabnik <steve@steveklabnik.com>"]
  
  [dependencies]
  semver="*"
  > cargo build
      Updating registry `https://github.com/rust-lang/crates.io-index`
     Compiling semver-parser v0.7.0
     Compiling semver v0.6.0
     Compiling star v0.1.0 (file:///C:/Users/steve/tmp/star)
      Finished dev [unoptimized + debuginfo] target(s) in 5.24 secs
I've filed https://github.com/rust-lang/cargo/issues/3971

I'm also not sure how you got your `join` error,

    let sline: Vec<&str> = vec![];
    sline.join("");
seems to compile just fine for me. Hard to tell without seeing your other code, I guess...


The Cargo problem turns out to be a known incompatibility between the version of Cargo which ships with Ubuntu 16.04 LTS and later version of Rust.[1][2][3] "Old versions of cargo cannot install any version of a crate that has a version with a prelease string". It's not the user's .toml file that's the problem; it's an internal dependency within the crate that's breaking Cargo.

It's necessary to run Rust's version of Cargo, not Ubuntu's, when using Rust. Due to a path problem, I was using Ubuntu's older versions of Rust and Cargo, but with libraries from the new Rust installation.

[1] https://users.rust-lang.org/t/crates-io-compatibility-with-o... [2] https://github.com/rust-lang/crates.io/issues/584 [3] https://github.com/rust-lang/cargo/issues/3763


Ah yes. This one is indirectly my fault, as I maintain the semver parsing library, and that included the bug. Sorry about that :(


> That code worked through at least Rust 1.2. So, yes, Rust has removed an API since 1.0. That code was compiling in December 2016.

How sure are you that this was compiled with Rust 1.2 and not some old rustc?

Here is a copy of the docs for Vec from June 2016: https://github.com/Manishearth/rust-internals-docs/blob/9419...

There is no join method there.

There is a join method on slices (which vectors dereference to). https://github.com/Manishearth/rust-internals-docs/blob/9419...

This method still exists. It used to take a delimeter argument, and works the same way today. https://play.rust-lang.org/?gist=13d19cd5dd33c1efb046cc69bec...

There have been various language tweaks, but Rust has not removed a (stable) API since 1.0.


Both of these errors are reproducible with the 1.2 compiler, but not with the 1.17 compiler. Most likely this user believed they were compiling with 1.17 but they were compiling with 1.2.


Ah, in that case I can guess what happened. SliceConcatExt was probably not in the prelude back then. Well, we never guaranteed forward compatibility :)


Might be that, might also be that SliceConcatExt only had connect in 1.2, not join.


No, it had join, see docs link above.


Is it me or does usage actually specify very clearly in the output you included where to put the arguments/options when a cargo command is specified?


>OK, what happened to ".join", and who had the great idea of taking it out?

.join was implemented using the unstable SliceConcatExt trait. You're kind of asking for things to break if you use unstable things. .join is now implemented on slices, and replaces .connect()




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: