rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.72k stars 12.64k forks source link

"type annotations required" errors in 1.28 beta #51844

Closed pietroalbini closed 6 years ago

pietroalbini commented 6 years ago

A bunch of crates failed to compile in 1.28 beta with error messages like these:

type annotations required: cannot resolve `std::io::Error: std::convert::From<_>`
type annotations required: cannot resolve `std::borrow::Cow<'_, str>: std::convert::From<&_>`'`
type annotations required: cannot resolve `std::string::String: std::convert::AsRef<_>`

Also, the following crates are failing because they depend on tokio-dns-unofficial:

mbillingr commented 6 years ago

I fixed this in openml (https://github.com/mbillingr/openml-rust/commit/96d7877e4e35365bf3c4e9e9ab7273f610ff7ad7) by changing Cow::from(self.as_ref()) to Cow::from(self.as_str()) (self is of type String). This is probably how it should have been written anyway.

sbstp commented 6 years ago

I don't see any errors in the build log of my crate. The fold issue was spotted and fixed a few weeks ago here. It seems like the issue in other crates is because they depend on old versions.

Any clue why this breaking change started happening? I don't think I can release a 0.1.2.

pietroalbini commented 6 years ago

I don't see any errors in the build log of my crate.

Copy-pasted the link for the wrong version, sorry. This is the one for 0.1.1.

Any clue why this breaking change started happening? I don't think I can release a 0.1.2.

I haven't investigated this yet. If it's a bug in the compiler we'll get this fixed before 1.28 reaches stable.

sbstp commented 6 years ago

Is it possible to backport the fix? The current version is 0.3.1, is cargo able to publish a 0.1.2 version that's semver compatible with the broken version? I guess I could yank that version, but the existing dependencies will still continue to break.

sfackler commented 6 years ago

You can publish a 0.1.2

sbstp commented 6 years ago

Alright, I've released 0.1.2 and it seems to have fixed the issue.

r-darwish commented 6 years ago

I also changed my code to as_str as it makes more sense.

@pietroalbini this process of checking the beta compiler by compiling actual crates is awesome. Is there any place in which I can read more about how it works?

mbillingr commented 6 years ago

@r-darwish I think crater is the tool in use.

Mark-Simulacrum commented 6 years ago

This is caused by b559710e58427213d6f82008206c22cf3d76b4c4, probably https://github.com/rust-lang/rust/pull/50170. cc @rust-lang/libs, I've closed https://github.com/rust-lang/rust/issues/50954 as a duplicate of this bug.

pietroalbini commented 6 years ago

Ping @rust-lang/libs, any news on this?

alexcrichton commented 6 years ago

We'll be discussing this in this week's triage meeting

alexcrichton commented 6 years ago

The conclusion of said discussion is that we're going to leave this as-is, but if any crates have difficulty updating we're more than willing to help!

jq-rs commented 6 years ago

Mles-client build is failing due to dependencies, thus it should work now as the dependencies are fixed. Just made a build with nightly, runs smoothly. So it was just miscategorized here.