-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE with clippy on nightly #4579
Comments
Thanks for the report! Are you able to share the code that triggers the ICE? That would help a lot with fixing the issue. If not, are you able to maybe provide a trimmed down version of the code that causes the ICE? |
Clippy panics at this line: rust-clippy/clippy_lints/src/consts.rs Line 228 in adc1df1
because rust-clippy/clippy_lints/src/copies.rs Line 325 in adc1df1
|
This ICE can be reproduced with the https://github.com/blackbeam/rust_mysql_common crate |
I couldn't repro directly by running clippy on mysql_common, but this code does it (there are likely simpler ways to reproduce, but this is my code trimmed down; the #![feature(async_await)]
use futures::executor::ThreadPool;
use mysql_async::{error::Error, Conn};
use std::future::Future;
pub struct ClippyIce;
impl ClippyIce {
async fn boom<R, Ft, F>(&mut self, _: F) -> Result<R, Error>
where
Ft: Future<Output = Result<(Conn, R), Error>>,
F: FnOnce(Conn) -> Ft,
{
unimplemented!()
}
}
fn main() {
ThreadPool::new()
.expect("Failed to create threadpool")
.run(ClippyIce.boom::<(), _, _>(|_| async { unimplemented!() }))
.unwrap();
} [dependencies]
mysql_async = "0.20"
futures-preview = "0.3.0-alpha.17" This builds fine with cargo check/build, but Clippy will crash on 2019-08-01 and pass on 2019-07-31. |
other data points to help: Compiler panics when compiling I tried to lint a project which have
with
I got the same error with the following Rust versions:
But it works with:
here is the repository to reproduce: https://gitlab.com/bloom42/phaser, just run Please note it does not panic when compiling, only when |
A quick fix while waiting for the fix is to use |
This minimal reproducer only ICEs because it depends on Here's a (minimal?) reproducer without external dependencies: use std::ptr;
fn main() {
match Some(0_usize) {
Some(_) => {
let s = "012345";
unsafe { ptr::read(s.as_ptr().offset(1) as *const [u8; 5]) };
// ^ No expr_ty for this expr
},
_ => (),
};
} |
Changes: ```` travis: temporarily disable rustfmt ci check until rust-lang#4742 is resolved rustup rust-lang/rust#65792 Fix ICE rust-lang#4579 Add regression test for ICE rust-lang#4579 Run update_lints for Unicode lint Re-add false positive check Add raw string regression test for useless_format lint Re-factor useless_format lint Update Unicode lint tests [Backported] Rustup to rust-lang/rust#59545 ```` Fixes ##65888
My project compiles fine on recent nightlies since July.
On
nightly-2019-07-31
, Clippy works fine. On the next nightly,nightly-2019-08-01
and until today (nightly-2019-09-25
), Clippy triggers an ICE. Something happened betweennightly-2019-07-31
andnightly-2019-08-01
that hasn't been fixed since.Command-line:
(I've been trying to run
cargo-bisect-rustc
with a script to invoke clippy, but didn't manage, it says the start of the range has the regression -- but I'm just invoking it wrong, not sure how to do it for clippy).Error on
nightly-2019-08-01
:Error on
nightly-2019-09-25
(double panic!):The text was updated successfully, but these errors were encountered: