about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-04-01 20:25:20 +0200
committerGitHub <noreply@github.com>2025-04-01 20:25:20 +0200
commitcdd69d6dc3fd05b594726c881b1ebd8ca8d63669 (patch)
tree1a1336b5ae2038fe9c3e56c7baee7ba2d4efe7a6
parent0b4a81a4ef637117b365c3c51a5326f1c4a90ded (diff)
parent7feac15ca7f601b7ef0dd63e9113103f720f5405 (diff)
downloadrust-cdd69d6dc3fd05b594726c881b1ebd8ca8d63669.tar.gz
rust-cdd69d6dc3fd05b594726c881b1ebd8ca8d63669.zip
Rollup merge of #110406 - aDotInTheVoid:rdj-derived-impl-attr, r=GuillaumeGomez
rustdoc-json: Add test for #[automatically_derived] attribute

~~Will fail CI due to https://github.com/freestrings/jsonpath/issues/91, but I wrote the test and don't want to forget it.~~

~~We should look into fixing the freestrings impl, or moving to a different one, so we can test things like this. [Zulip Disussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/jsonpath-plus.20integration)~~

FIXED!!! By #138763

r? ````@ghost````

````@rustbot```` blocked
-rw-r--r--tests/rustdoc-json/attrs/automatically_derived.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/rustdoc-json/attrs/automatically_derived.rs b/tests/rustdoc-json/attrs/automatically_derived.rs
new file mode 100644
index 00000000000..4e1ab3d145e
--- /dev/null
+++ b/tests/rustdoc-json/attrs/automatically_derived.rs
@@ -0,0 +1,13 @@
+#[derive(Default)]
+pub struct Derive;
+
+pub struct Manual;
+
+impl Default for Manual {
+    fn default() -> Self {
+        Self
+    }
+}
+
+//@ is '$.index[?(@.inner.impl.for.resolved_path.path == "Derive" && @.inner.impl.trait.path == "Default")].attrs' '["#[automatically_derived]"]'
+//@ is '$.index[?(@.inner.impl.for.resolved_path.path == "Manual" && @.inner.impl.trait.path == "Default")].attrs' '[]'