summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/trait-hidden-method.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/trait-hidden-method.rs')
-rw-r--r--tests/ui/suggestions/trait-hidden-method.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/suggestions/trait-hidden-method.rs b/tests/ui/suggestions/trait-hidden-method.rs
new file mode 100644
index 000000000..ae7ef47e1
--- /dev/null
+++ b/tests/ui/suggestions/trait-hidden-method.rs
@@ -0,0 +1,11 @@
+// #107983 - testing that `__iterator_get_unchecked` isn't suggested
+// HELP included so that compiletest errors on the bad suggestion
+pub fn i_can_has_iterator() -> impl Iterator<Item = u32> {
+ //~^ ERROR expected `Box<dyn Iterator>`
+ //~| HELP consider constraining the associated type
+ Box::new(1..=10) as Box<dyn Iterator>
+ //~^ ERROR the value of the associated type `Item`
+ //~| HELP specify the associated type
+}
+
+fn main() {}