Yes, star dependencies were removed like a year ago, for semver issues. They went through multiple release cycles of warnings.
Yes, star dependencies were removed like a year ago, for semver issues. They went through multiple release cycles of warnings.
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.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/3971I'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...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
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.
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).