diff --git a/src/test/rustdoc-js/generics-multi-trait.js b/src/test/rustdoc-js/generics-multi-trait.js new file mode 100644 index 0000000000000..e7fcea876c85c --- /dev/null +++ b/src/test/rustdoc-js/generics-multi-trait.js @@ -0,0 +1,32 @@ +// exact-check + +const QUERY = [ + 'Result', + 'Zzzzzzzzzzzzzzzzzz', + 'Nonononononononono', +]; + +const EXPECTED = [ + // check one of the generic items + { + 'in_args': [ + { 'path': 'generics_multi_trait', 'name': 'beta' }, + ], + 'returned': [ + { 'path': 'generics_multi_trait', 'name': 'bet' }, + ], + }, + { + 'in_args': [ + { 'path': 'generics_multi_trait', 'name': 'beta' }, + ], + 'returned': [ + { 'path': 'generics_multi_trait', 'name': 'bet' }, + ], + }, + // ignore the name of the generic itself + { + 'in_args': [], + 'returned': [], + }, +]; diff --git a/src/test/rustdoc-js/generics-multi-trait.rs b/src/test/rustdoc-js/generics-multi-trait.rs new file mode 100644 index 0000000000000..e6fd06d254ccd --- /dev/null +++ b/src/test/rustdoc-js/generics-multi-trait.rs @@ -0,0 +1,12 @@ +pub trait SomeTrait {} +pub trait Zzzzzzzzzzzzzzzzzz {} + +pub fn bet() -> Result { + loop {} +} + +pub fn beta( + _param: Result, +) { + loop {} +}