about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-09-15 02:29:43 +0200
committerGitHub <noreply@github.com>2019-09-15 02:29:43 +0200
commit8f55245fdc7d3ad26e2dff1e61d2b6efa293d3d0 (patch)
treef5a949dbf00869c7a1a5c051a5c42b2a5f32f948 /src/test
parentb35ebac96102cd12406d9d87827b0838d129c278 (diff)
parentc681cf781b440620aca8cad4be9b76a477fc6c1a (diff)
downloadrust-8f55245fdc7d3ad26e2dff1e61d2b6efa293d3d0.tar.gz
rust-8f55245fdc7d3ad26e2dff1e61d2b6efa293d3d0.zip
Rollup merge of #64457 - petrochenkov:macunfield, r=matthewjasper
def_collector: Do not ICE on attributes on unnamed fields

The primary issue here is that the expansion infra needs to visit a field in isolation, and fields don't know their own indices during expansion, so they have to be kept in some other place (e.g. `struct Definitions`).

Fixes https://github.com/rust-lang/rust/issues/64385
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/attributes/unnamed-field-attributes.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/attributes/unnamed-field-attributes.rs b/src/test/ui/attributes/unnamed-field-attributes.rs
new file mode 100644
index 00000000000..93f364047e9
--- /dev/null
+++ b/src/test/ui/attributes/unnamed-field-attributes.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+struct S(
+    #[rustfmt::skip] u8,
+    u16,
+    #[rustfmt::skip] u32,
+);
+
+fn main() {}