summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/crashes/ice-2862.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/crashes/ice-2862.rs')
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-2862.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/crashes/ice-2862.rs b/src/tools/clippy/tests/ui/crashes/ice-2862.rs
new file mode 100644
index 000000000..8326e3663
--- /dev/null
+++ b/src/tools/clippy/tests/ui/crashes/ice-2862.rs
@@ -0,0 +1,16 @@
+/// Test for https://github.com/rust-lang/rust-clippy/issues/2862
+
+pub trait FooMap {
+ fn map<B, F: Fn() -> B>(&self, f: F) -> B;
+}
+
+impl FooMap for bool {
+ fn map<B, F: Fn() -> B>(&self, f: F) -> B {
+ f()
+ }
+}
+
+fn main() {
+ let a = true;
+ a.map(|| false);
+}