mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 12:13:43 +00:00
rustdoc: add test case for multiple traits and erased names
https://github.com/rust-lang/rust/pull/92339#discussion_r792805289
This commit is contained in:
parent
a7f375789b
commit
f5cdfb47e5
32
src/test/rustdoc-js/generics-multi-trait.js
Normal file
32
src/test/rustdoc-js/generics-multi-trait.js
Normal file
@ -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
src/test/rustdoc-js/generics-multi-trait.rs
Normal file
12
src/test/rustdoc-js/generics-multi-trait.rs
Normal file
@ -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 {}
|
||||
}
|
Loading…
Reference in New Issue
Block a user