Skip to content

rustdoc: add test case for multiple traits and erased names #93339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/test/rustdoc-js/generics-multi-trait.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// exact-check

const QUERY = [
'Result<SomeTrait>',
'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': [],
},
];
12 changes: 12 additions & 0 deletions src/test/rustdoc-js/generics-multi-trait.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pub trait SomeTrait {}
pub trait Zzzzzzzzzzzzzzzzzz {}

pub fn bet<Nonononononononono: SomeTrait + Zzzzzzzzzzzzzzzzzz>() -> Result<Nonononononononono, ()> {
loop {}
}

pub fn beta<Nonononononononono: SomeTrait + Zzzzzzzzzzzzzzzzzz>(
_param: Result<Nonononononononono, ()>,
) {
loop {}
}