Moved from https://github.com/rust-lang/rust/issues/49207
Happens when compiling diesel on nightly
https://travis-ci.org/diesel-rs/diesel/jobs/355827115#L499
Error comes from https://github.com/rust-lang-nursery/rust-clippy/blob/4edd140e57cce900fa930e1439bab469f5bbce46/clippy_lints/src/utils/conf.rs#L214-L219
I played around with this for a couple of hours, but from what I saw, the problem might be a nonexistent yet specified conf file. Two steps back in the backtrace from the code snippet mentioned in the description, there's this line. Earlier in the same block we have these lines.
Looking around in Diesel, whenever Clippy is mentioned, a conf file is provided as seen here, but the files don't exist in the repo. Is this the same conf file that clippy_lint is looking for, or a more general Clippy conf file?
So there's two separate problems here. The first is the incorrect assumption that toml::from_str("") is now erroring. However, Diesel should have never been hitting that code path, as we specify a config file that exists. The root of that problem is due to the usage of env::current_dir() to resolve the path. The working directory for compilation with Cargo changed in the most recent version of Rust. The solution here is to use env::var("CARGO_MANIFEST_DIR") instead.
Ref https://github.com/rust-lang/rust/issues/47462 for confirmation that the working directory during compilation should not be relied on
I fixed the current dir usage. @killercup had ideas about the toml iirc
I'm pretty sure it's because of the proc-macro2/nightly feature. Clone https://github.com/mikerite/clippy_issue_2560 and run cargo build to reproduce.
New versions of proc-macro2 have been released. Updating to 0.3.0 and above seems to fix the problem in my test repository.
It looks like Diesel has been successfully upgraded to clippy 0.0.195 (diesel-rs/diesel#1674).
This issue should be closed IMO.