about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorBryanskiy <ivakin.kir@gmail.com>2025-03-12 15:59:21 +0300
committerBryanskiy <ivakin.kir@gmail.com>2025-03-12 15:59:37 +0300
commit7bfe2136e4ffa5b5f6c85f0544a5d7ef8ab2b705 (patch)
tree940ebd909e64ad401150b8cb77e05abf2c44180d /tests/ui
parent57a4736e9f4b7e8089b2db60583607f3b550c862 (diff)
downloadrust-7bfe2136e4ffa5b5f6c85f0544a5d7ef8ab2b705.tar.gz
rust-7bfe2136e4ffa5b5f6c85f0544a5d7ef8ab2b705.zip
Delegation: one more ICE fix for `MethodCall` generation
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/delegation/ice-issue-138362.rs15
-rw-r--r--tests/ui/delegation/ice-issue-138362.stderr19
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/ui/delegation/ice-issue-138362.rs b/tests/ui/delegation/ice-issue-138362.rs
new file mode 100644
index 00000000000..c3066009855
--- /dev/null
+++ b/tests/ui/delegation/ice-issue-138362.rs
@@ -0,0 +1,15 @@
+#![feature(fn_delegation)]
+#![allow(incomplete_features)]
+
+trait HasSelf {
+    fn method(self);
+}
+trait NoSelf {
+    fn method();
+}
+impl NoSelf for u8 {
+    reuse HasSelf::method;
+    //~^ ERROR this function takes 1 argument but 0 arguments were supplied
+}
+
+fn main() {}
diff --git a/tests/ui/delegation/ice-issue-138362.stderr b/tests/ui/delegation/ice-issue-138362.stderr
new file mode 100644
index 00000000000..9feddc9feae
--- /dev/null
+++ b/tests/ui/delegation/ice-issue-138362.stderr
@@ -0,0 +1,19 @@
+error[E0061]: this function takes 1 argument but 0 arguments were supplied
+  --> $DIR/ice-issue-138362.rs:11:20
+   |
+LL |     reuse HasSelf::method;
+   |                    ^^^^^^ argument #1 is missing
+   |
+note: method defined here
+  --> $DIR/ice-issue-138362.rs:5:8
+   |
+LL |     fn method(self);
+   |        ^^^^^^ ----
+help: provide the argument
+   |
+LL |     reuse HasSelf::method(/* value */);
+   |                          +++++++++++++
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0061`.