about summary refs log tree commit diff
path: root/tests/ui/traits/suggest-deferences/root-obligation.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/suggest-deferences/root-obligation.fixed')
-rw-r--r--tests/ui/traits/suggest-deferences/root-obligation.fixed13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/traits/suggest-deferences/root-obligation.fixed b/tests/ui/traits/suggest-deferences/root-obligation.fixed
new file mode 100644
index 00000000000..7a8433f9057
--- /dev/null
+++ b/tests/ui/traits/suggest-deferences/root-obligation.fixed
@@ -0,0 +1,13 @@
+// run-rustfix
+
+fn get_vowel_count(string: &str) -> usize {
+    string
+        .chars()
+        .filter(|c| "aeiou".contains(*c))
+        //~^ ERROR expected a `Fn<(char,)>` closure, found `char`
+        .count()
+}
+
+fn main() {
+    let _ = get_vowel_count("asdf");
+}