Closed
Description
This code causes Clippy to panic:
enum Foo {
Bar,
Baz,
}
fn bar(foo: Foo) {
macro_rules! baz {
() => {
if let Foo::Bar = foo {}
};
}
baz!();
baz!();
}
Here is the output of cargo +nightly clippy
:
Checking foo v0.1.0 (C:\foo)
...
thread 'main' panicked at 'begin <= end (33 <= 30) when slicing ` if
`', src\libcore\str\mod.rs:2096:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.32.0-nightly (6bfb46e4a 2018-11-26) running on x86_64-pc-windows-msvc
note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `foo`.
To learn more, run the command again with --verbose.
I have clippy 0.0.212 (754b4c07 2018-11-23)
, but the bug is reproducible on clippy 0.0.212 (125907ad 2018-09-17)
as well.