about summary refs log tree commit diff
path: root/tests/ui/parser/tuple-index-suffix-proc-macro.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-09 18:14:23 +0000
committerbors <bors@rust-lang.org>2025-09-09 18:14:23 +0000
commit7ad23f43a225546c095123de52cc07d8719f8e2b (patch)
tree0e99435039bfbf29f791983825ed7062bc785f77 /tests/ui/parser/tuple-index-suffix-proc-macro.rs
parent364da5d88d772fa40fb20353443595385443ac25 (diff)
parenta40ec4c50a0a0475123675c3f4202eaf5cbedb77 (diff)
downloadrust-7ad23f43a225546c095123de52cc07d8719f8e2b.tar.gz
rust-7ad23f43a225546c095123de52cc07d8719f8e2b.zip
Auto merge of #146375 - matthiaskrgr:rollup-utik9zj, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#145463 (Reject invalid literal suffixes in tuple indexing, tuple struct indexing, and struct field name position)
 - rust-lang/rust#145929 (fix APITIT being treated as a normal generic parameter in suggestions)
 - rust-lang/rust#146001 (Update getopts to remove unicode-width dependency)
 - rust-lang/rust#146365 (triagebot: warn about #[rustc_intrinsic_const_stable_indirect])
 - rust-lang/rust#146366 (add approx_delta to all gamma tests)
 - rust-lang/rust#146373 (fix comments about trait solver cycle heads)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/parser/tuple-index-suffix-proc-macro.rs')
-rw-r--r--tests/ui/parser/tuple-index-suffix-proc-macro.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/ui/parser/tuple-index-suffix-proc-macro.rs b/tests/ui/parser/tuple-index-suffix-proc-macro.rs
new file mode 100644
index 00000000000..557c67738d3
--- /dev/null
+++ b/tests/ui/parser/tuple-index-suffix-proc-macro.rs
@@ -0,0 +1,32 @@
+//! See #59418.
+//!
+//! Like `tuple-index-suffix.rs`, but exercises the proc-macro interaction.
+
+//@ proc-macro: tuple-index-suffix-proc-macro-aux.rs
+
+extern crate tuple_index_suffix_proc_macro_aux;
+use tuple_index_suffix_proc_macro_aux as aux;
+
+fn main() {
+    struct TupStruct(i32);
+    let tup_struct = TupStruct(42);
+
+    // Previously, #60186 had carve outs for `{i,u}{32,usize}` as non-lint pseudo-FCW warnings. Now,
+    // they all hard error.
+
+    aux::bad_tup_indexing!(0usize);
+    //~^ ERROR suffixes on a tuple index are invalid
+    aux::bad_tup_struct_indexing!(tup_struct, 0isize);
+    //~^ ERROR suffixes on a tuple index are invalid
+
+    // Not part of the #60186 carve outs.
+
+    aux::bad_tup_indexing!(0u8);
+    //~^ ERROR suffixes on a tuple index are invalid
+    aux::bad_tup_struct_indexing!(tup_struct, 0u64);
+    //~^ ERROR suffixes on a tuple index are invalid
+
+    // NOTE: didn't bother with trying to figure out how to generate `struct P { 0u32: u32 }` using
+    // *only* `proc_macro` without help with `syn`/`quote`, looks like you can't with just
+    // `proc_macro::quote`?
+}