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.
Co-authored-by: Noah Lev <[email protected]>
- Loading branch information
Showing
3 changed files
with
82 additions
and
2 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
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 | ||
} | ||
} |