about summary refs log tree commit diff
path: root/tests/ui/proc-macro
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2025-09-23 15:32:25 +0200
committerlcnr <rust@lcnr.de>2025-09-26 16:33:15 +0200
commit6b379b560df483307958f2a606a1dd514fff36ca (patch)
tree857c1e760d4c66445a8295f657a97ab7253109a1 /tests/ui/proc-macro
parent70f6493f261810b07d69ab0ffb661cf4ed8a97a7 (diff)
downloadrust-6b379b560df483307958f2a606a1dd514fff36ca.tar.gz
rust-6b379b560df483307958f2a606a1dd514fff36ca.zip
use `try_structurally_resolve_type` for method receiver
We'll still error due to the `opt_bad_ty` of `method_autoderef_steps`.
This slightly worsens the span of `infer_var.method()` which is now the
same as for `Box::new(infer_var).method()`.

Unlike `structurally_resolve_type`, `probe_op` does not check whether
the infcx is already tainted, so this results in 2 previously not emitted
errors.
Diffstat (limited to 'tests/ui/proc-macro')
-rw-r--r--tests/ui/proc-macro/quote/not-repeatable.rs4
-rw-r--r--tests/ui/proc-macro/quote/not-repeatable.stderr11
2 files changed, 12 insertions, 3 deletions
diff --git a/tests/ui/proc-macro/quote/not-repeatable.rs b/tests/ui/proc-macro/quote/not-repeatable.rs
index 0291e4ddf88..373f0e74dbd 100644
--- a/tests/ui/proc-macro/quote/not-repeatable.rs
+++ b/tests/ui/proc-macro/quote/not-repeatable.rs
@@ -8,5 +8,7 @@ struct Ipv4Addr;
 
 fn main() {
     let ip = Ipv4Addr;
-    let _ = quote! { $($ip)* }; //~ ERROR the method `quote_into_iter` exists for struct `Ipv4Addr`, but its trait bounds were not satisfied
+    let _ = quote! { $($ip)* };
+    //~^ ERROR the method `quote_into_iter` exists for struct `Ipv4Addr`, but its trait bounds were not satisfied
+    //~| ERROR type annotations needed
 }
diff --git a/tests/ui/proc-macro/quote/not-repeatable.stderr b/tests/ui/proc-macro/quote/not-repeatable.stderr
index aeda08d7de6..ff31799abb0 100644
--- a/tests/ui/proc-macro/quote/not-repeatable.stderr
+++ b/tests/ui/proc-macro/quote/not-repeatable.stderr
@@ -20,6 +20,13 @@ note: the traits `Iterator` and `ToTokens` must be implemented
   --> $SRC_DIR/proc_macro/src/to_tokens.rs:LL:COL
   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
 
-error: aborting due to 1 previous error
+error[E0282]: type annotations needed
+  --> $DIR/not-repeatable.rs:11:13
+   |
+LL |     let _ = quote! { $($ip)* };
+   |             ^^^^^^^^^^^^^^^^^^ cannot infer type
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0599`.
+Some errors have detailed explanations: E0282, E0599.
+For more information about an error, try `rustc --explain E0282`.