about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYoshitomo Nakanishi <yurayura.rounin.3@gmail.com>2021-02-13 22:12:59 +0900
committerYoshitomo Nakanishi <yurayura.rounin.3@gmail.com>2021-02-14 01:20:30 +0900
commit87109bb4f599bb8ac7b1c3a970337ac92cb3031c (patch)
treef3bc97335d7767c7287aff7fe4e6f3459f7acca1
parent047f3e16bfc158717c6aeaa152a31eb42f3b9f04 (diff)
downloadrust-87109bb4f599bb8ac7b1c3a970337ac92cb3031c.tar.gz
rust-87109bb4f599bb8ac7b1c3a970337ac92cb3031c.zip
Add minimal reproducer for ICE in #6179
-rw-r--r--tests/ui/crashes/ice-6179.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/crashes/ice-6179.rs b/tests/ui/crashes/ice-6179.rs
new file mode 100644
index 00000000000..f8c866a49aa
--- /dev/null
+++ b/tests/ui/crashes/ice-6179.rs
@@ -0,0 +1,21 @@
+//! This is a minimal reproducer for the ICE in https://github.com/rust-lang/rust-clippy/pull/6179.
+//! The ICE is mainly caused by using `hir_ty_to_ty`. See the discussion in the PR for details.
+
+#![warn(clippy::use_self)]
+#![allow(dead_code)]
+
+struct Foo {}
+
+impl Foo {
+    fn foo() -> Self {
+        impl Foo {
+            fn bar() {}
+        }
+
+        let _: _ = 1;
+
+        Self {}
+    }
+}
+
+fn main() {}