about summary refs log tree commit diff
path: root/tests/ui/const-generics/infer/method-chain.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/infer/method-chain.rs')
-rw-r--r--tests/ui/const-generics/infer/method-chain.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/const-generics/infer/method-chain.rs b/tests/ui/const-generics/infer/method-chain.rs
new file mode 100644
index 00000000000..0c5eed4894c
--- /dev/null
+++ b/tests/ui/const-generics/infer/method-chain.rs
@@ -0,0 +1,16 @@
+struct Foo;
+
+impl Foo {
+    fn bar(self) -> Foo {
+        Foo
+    }
+
+    fn baz<const N: usize>(self) -> Foo {
+        println!("baz: {}", N);
+        Foo
+    }
+}
+
+fn main() {
+    Foo.bar().bar().bar().bar().baz(); //~ ERROR type annotations needed
+}