Rollup merge of #108875 - notriddle:notriddle/return-trait, r=GuillaumeGomez
rustdoc: fix type search for `Option` combinators
This commit is contained in:
commit
aa881f16ec
4 changed files with 50 additions and 9 deletions
|
@ -1,7 +1,18 @@
|
|||
const QUERY = 'option, fnonce -> option';
|
||||
const QUERY = [
|
||||
'option, fnonce -> option',
|
||||
'option -> default',
|
||||
];
|
||||
|
||||
const EXPECTED = {
|
||||
'others': [
|
||||
{ 'path': 'std::option::Option', 'name': 'map' },
|
||||
],
|
||||
};
|
||||
const EXPECTED = [
|
||||
{
|
||||
'others': [
|
||||
{ 'path': 'std::option::Option', 'name': 'map' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'others': [
|
||||
{ 'path': 'std::option::Option', 'name': 'unwrap_or_default' },
|
||||
{ 'path': 'std::option::Option', 'name': 'get_or_insert_default' },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const QUERY = ['trait<nested>', '-> trait<nested>', 't1, t2'];
|
||||
const QUERY = ['trait<nested>', '-> trait<nested>', 't1, t2', '-> shazam', 'drizzel -> shazam'];
|
||||
|
||||
const EXPECTED = [
|
||||
{
|
||||
|
@ -16,4 +16,15 @@ const EXPECTED = [
|
|||
{ 'path': 'where_clause', 'name': 'presto' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'others': [
|
||||
{ 'path': 'where_clause', 'name': 'bippety' },
|
||||
{ 'path': 'where_clause::Drizzel', 'name': 'boppety' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'others': [
|
||||
{ 'path': 'where_clause::Drizzel', 'name': 'boppety' },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
|
@ -14,3 +14,17 @@ pub trait T2<'a, T> {
|
|||
}
|
||||
|
||||
pub fn presto<A, B>(_: A, _: B) where A: T1, B: for <'b> T2<'b, Nested> {}
|
||||
|
||||
pub trait Shazam {}
|
||||
|
||||
pub fn bippety<X>() -> &'static X where X: Shazam {
|
||||
panic!()
|
||||
}
|
||||
|
||||
pub struct Drizzel<T>(T);
|
||||
|
||||
impl<T> Drizzel<T> {
|
||||
pub fn boppety(&self) -> &T where T: Shazam {
|
||||
panic!();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue