From 0e2af5cc63065db84ffee23532ec572e644e4cf4 Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Mon, 2 Nov 2020 22:19:36 +0100 Subject: Check predicates from blanket trait impls while testing if they apply --- src/test/rustdoc/issue-78673.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/rustdoc/issue-78673.rs (limited to 'src/test') diff --git a/src/test/rustdoc/issue-78673.rs b/src/test/rustdoc/issue-78673.rs new file mode 100644 index 00000000000..d09141c3204 --- /dev/null +++ b/src/test/rustdoc/issue-78673.rs @@ -0,0 +1,24 @@ +#![crate_name = "issue_78673"] + +pub trait Something {} + +pub trait AnAmazingTrait {} + +impl AnAmazingTrait for T {} + +// @has 'issue_78673/struct.MyStruct.html' +// @has - '//*[@class="impl"]' 'AnAmazingTrait for MyStruct' +// @!has - '//*[@class="impl"]' 'AnAmazingTrait for T' +pub struct MyStruct; + +impl AnAmazingTrait for MyStruct {} + +// generic structs may have _both_ specific and blanket impls that apply + +// @has 'issue_78673/struct.AnotherStruct.html' +// @has - '//*[@class="impl"]' 'AnAmazingTrait for AnotherStruct<()>' +// @has - '//*[@class="impl"]' 'AnAmazingTrait for T' +pub struct AnotherStruct(T); + +impl Something for AnotherStruct {} +impl AnAmazingTrait for AnotherStruct<()> {} -- cgit 1.4.1-3-g733a5