about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/crashes/ice-11803.rs9
-rw-r--r--tests/ui/crashes/ice-11803.stderr26
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/ui/crashes/ice-11803.rs b/tests/ui/crashes/ice-11803.rs
new file mode 100644
index 00000000000..1bb8bf0c746
--- /dev/null
+++ b/tests/ui/crashes/ice-11803.rs
@@ -0,0 +1,9 @@
+//@no-rustfix
+
+#![warn(clippy::impl_trait_in_params)]
+
+pub fn g<T: IntoIterator<Item = impl Iterator<Item = impl Clone>>>() {
+    extern "C" fn implementation_detail() {}
+}
+
+fn main() {}
diff --git a/tests/ui/crashes/ice-11803.stderr b/tests/ui/crashes/ice-11803.stderr
new file mode 100644
index 00000000000..b8289048a8b
--- /dev/null
+++ b/tests/ui/crashes/ice-11803.stderr
@@ -0,0 +1,26 @@
+error: `impl Trait` used as a function parameter
+  --> $DIR/ice-11803.rs:5:54
+   |
+LL | pub fn g<T: IntoIterator<Item = impl Iterator<Item = impl Clone>>>() {
+   |                                                      ^^^^^^^^^^
+   |
+   = note: `-D clippy::impl-trait-in-params` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::impl_trait_in_params)]`
+help: add a type parameter
+   |
+LL | pub fn g<T: IntoIterator<Item = impl Iterator<Item = impl Clone>>, { /* Generic name */ }: Clone>() {
+   |                                                                  +++++++++++++++++++++++++++++++
+
+error: `impl Trait` used as a function parameter
+  --> $DIR/ice-11803.rs:5:33
+   |
+LL | pub fn g<T: IntoIterator<Item = impl Iterator<Item = impl Clone>>>() {
+   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: add a type parameter
+   |
+LL | pub fn g<T: IntoIterator<Item = impl Iterator<Item = impl Clone>>, { /* Generic name */ }: Iterator<Item = impl Clone>>() {
+   |                                                                  +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+error: aborting due to 2 previous errors
+