summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-43420-no-over-suggest.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-43420-no-over-suggest.rs')
-rw-r--r--tests/ui/issues/issue-43420-no-over-suggest.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-43420-no-over-suggest.rs b/tests/ui/issues/issue-43420-no-over-suggest.rs
new file mode 100644
index 000000000..4365bff5a
--- /dev/null
+++ b/tests/ui/issues/issue-43420-no-over-suggest.rs
@@ -0,0 +1,9 @@
+// check that we substitute type parameters before we suggest anything - otherwise
+// we would suggest function such as `as_slice` for the `&[u16]`.
+
+fn foo(b: &[u16]) {}
+
+fn main() {
+ let a: Vec<u8> = Vec::new();
+ foo(&a); //~ ERROR mismatched types
+}