forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#97592 - notriddle:notriddle/impl-trait, r=G…
…uillaumeGomez rustdoc: also index impl trait and raw pointers Revives rust-lang#92339
- Loading branch information
Showing
6 changed files
with
182 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// ignore-order | ||
|
||
const QUERY = [ | ||
'Aaaaaaa -> i32', | ||
'Aaaaaaa -> Aaaaaaa', | ||
'Aaaaaaa -> usize', | ||
'-> Aaaaaaa', | ||
'Aaaaaaa', | ||
]; | ||
|
||
const EXPECTED = [ | ||
{ | ||
// Aaaaaaa -> i32 | ||
'others': [ | ||
{ 'path': 'impl_trait::Ccccccc', 'name': 'eeeeeee' }, | ||
], | ||
}, | ||
{ | ||
// Aaaaaaa -> Aaaaaaa | ||
'others': [ | ||
{ 'path': 'impl_trait::Ccccccc', 'name': 'fffffff' }, | ||
], | ||
}, | ||
{ | ||
// Aaaaaaa -> usize | ||
'others': [], | ||
}, | ||
{ | ||
// -> Aaaaaaa | ||
'others': [ | ||
{ 'path': 'impl_trait::Ccccccc', 'name': 'fffffff' }, | ||
{ 'path': 'impl_trait::Ccccccc', 'name': 'ddddddd' }, | ||
{ 'path': 'impl_trait', 'name': 'bbbbbbb' }, | ||
], | ||
}, | ||
{ | ||
// Aaaaaaa | ||
'others': [ | ||
{ 'path': 'impl_trait', 'name': 'Aaaaaaa' }, | ||
], | ||
'in_args': [ | ||
{ 'path': 'impl_trait::Ccccccc', 'name': 'fffffff' }, | ||
{ 'path': 'impl_trait::Ccccccc', 'name': 'eeeeeee' }, | ||
], | ||
'returned': [ | ||
{ 'path': 'impl_trait::Ccccccc', 'name': 'fffffff' }, | ||
{ 'path': 'impl_trait::Ccccccc', 'name': 'ddddddd' }, | ||
{ 'path': 'impl_trait', 'name': 'bbbbbbb' }, | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
pub trait Aaaaaaa {} | ||
|
||
impl Aaaaaaa for () {} | ||
|
||
pub fn bbbbbbb() -> impl Aaaaaaa { | ||
() | ||
} | ||
|
||
pub struct Ccccccc {} | ||
|
||
impl Ccccccc { | ||
pub fn ddddddd(&self) -> impl Aaaaaaa { | ||
() | ||
} | ||
pub fn eeeeeee(&self, _x: impl Aaaaaaa) -> i32 { | ||
0 | ||
} | ||
pub fn fffffff(&self, x: impl Aaaaaaa) -> impl Aaaaaaa { | ||
x | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// ignore-order | ||
|
||
const QUERY = [ | ||
'Aaaaaaa -> i32', | ||
'Aaaaaaa -> Aaaaaaa', | ||
'Aaaaaaa -> usize', | ||
'-> Aaaaaaa', | ||
'Aaaaaaa', | ||
]; | ||
|
||
const EXPECTED = [ | ||
{ | ||
// Aaaaaaa -> i32 | ||
'others': [ | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'eeeeeee' }, | ||
], | ||
}, | ||
{ | ||
// Aaaaaaa -> Aaaaaaa | ||
'others': [ | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'fffffff' }, | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'ggggggg' }, | ||
], | ||
}, | ||
{ | ||
// Aaaaaaa -> usize | ||
'others': [], | ||
}, | ||
{ | ||
// -> Aaaaaaa | ||
'others': [ | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'fffffff' }, | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'ggggggg' }, | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'ddddddd' }, | ||
{ 'path': 'raw_pointer', 'name': 'bbbbbbb' }, | ||
], | ||
}, | ||
{ | ||
// Aaaaaaa | ||
'others': [ | ||
{ 'path': 'raw_pointer', 'name': 'Aaaaaaa' }, | ||
], | ||
'in_args': [ | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'fffffff' }, | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'ggggggg' }, | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'eeeeeee' }, | ||
], | ||
'returned': [ | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'fffffff' }, | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'ggggggg' }, | ||
{ 'path': 'raw_pointer::Ccccccc', 'name': 'ddddddd' }, | ||
{ 'path': 'raw_pointer', 'name': 'bbbbbbb' }, | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use std::ptr; | ||
|
||
pub struct Aaaaaaa {} | ||
|
||
pub fn bbbbbbb() -> *const Aaaaaaa { | ||
ptr::null() | ||
} | ||
|
||
pub struct Ccccccc {} | ||
|
||
impl Ccccccc { | ||
pub fn ddddddd(&self) -> *const Aaaaaaa { | ||
ptr::null() | ||
} | ||
pub fn eeeeeee(&self, _x: *const Aaaaaaa) -> i32 { | ||
0 | ||
} | ||
pub fn fffffff(&self, x: *const Aaaaaaa) -> *const Aaaaaaa { | ||
x | ||
} | ||
pub fn ggggggg(&self, x: *mut Aaaaaaa) -> *mut Aaaaaaa { | ||
x | ||
} | ||
} |