From 6d10fd0b5b2a2ac2c79556d42608476241d68b36 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 15 Apr 2022 21:53:02 +0200 Subject: [PATCH] Add regression test for rustdoc duplicated blanket impls --- src/test/rustdoc/duplicated_impl.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/test/rustdoc/duplicated_impl.rs diff --git a/src/test/rustdoc/duplicated_impl.rs b/src/test/rustdoc/duplicated_impl.rs new file mode 100644 index 0000000000000..4e901b31c9076 --- /dev/null +++ b/src/test/rustdoc/duplicated_impl.rs @@ -0,0 +1,14 @@ +// This test ensures that the same implementation doesn't show more than once. +// It's a regression test for https://github.com/rust-lang/rust/issues/96036. + +#![crate_name = "foo"] + +// We check that there is only one "impl Something for T" listed in the +// blanket implementations. + +// @has 'foo/struct.Whatever.html' +// @count - '//*[@id="blanket-implementations-list"]/section[@class="impl has-srclink"]' 1 + +pub trait Something { } +pub struct Whatever; +impl Something for T {}