about summary refs log tree commit diff
path: root/tests/ui/span
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-06-18 18:06:49 +0200
committerGitHub <noreply@github.com>2025-06-18 18:06:49 +0200
commit0093ca5c760df11bfab0c9c556addef7b508acbc (patch)
tree468cd174d11148efc3562e066bca94598841483d /tests/ui/span
parentff146112f669845e9fbee95406560bda37e2e4e7 (diff)
parentfe04ae7fafab80cebd01ce9c199248556ec3654f (diff)
downloadrust-0093ca5c760df11bfab0c9c556addef7b508acbc.tar.gz
rust-0093ca5c760df11bfab0c9c556addef7b508acbc.zip
Rollup merge of #141610 - BoxyUwU:stabilize_generic_arg_infer, r=lcnr,traviscross
Stabilize `feature(generic_arg_infer)`

Fixes rust-lang/rust#85077

r? lcnr

cc ````@rust-lang/project-const-generics````
Diffstat (limited to 'tests/ui/span')
-rw-r--r--tests/ui/span/issue-42234-unknown-receiver-type.rs3
-rw-r--r--tests/ui/span/issue-42234-unknown-receiver-type.stderr23
2 files changed, 23 insertions, 3 deletions
diff --git a/tests/ui/span/issue-42234-unknown-receiver-type.rs b/tests/ui/span/issue-42234-unknown-receiver-type.rs
index 53d1e3eed82..8f7bbf0fe5e 100644
--- a/tests/ui/span/issue-42234-unknown-receiver-type.rs
+++ b/tests/ui/span/issue-42234-unknown-receiver-type.rs
@@ -1,6 +1,3 @@
-//@ revisions: full generic_arg
-#![cfg_attr(generic_arg, feature(generic_arg_infer))]
-
 // When the type of a method call's receiver is unknown, the span should point
 // to the receiver (and not the entire call, as was previously the case before
 // the fix of which this tests).
diff --git a/tests/ui/span/issue-42234-unknown-receiver-type.stderr b/tests/ui/span/issue-42234-unknown-receiver-type.stderr
new file mode 100644
index 00000000000..10308ec07da
--- /dev/null
+++ b/tests/ui/span/issue-42234-unknown-receiver-type.stderr
@@ -0,0 +1,23 @@
+error[E0282]: type annotations needed
+  --> $DIR/issue-42234-unknown-receiver-type.rs:6:24
+   |
+LL |     let x: Option<_> = None;
+   |                        ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option`
+LL |     x.unwrap().method_that_could_exist_on_some_type();
+   |     ---------- type must be known at this point
+   |
+help: consider specifying the generic argument
+   |
+LL |     let x: Option<_> = None::<T>;
+   |                            +++++
+
+error[E0282]: type annotations needed
+  --> $DIR/issue-42234-unknown-receiver-type.rs:12:10
+   |
+LL |         .sum::<_>()
+   |          ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
+   |
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0282`.