forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustdoc-search: fix bugs when unboxing and reordering combine
- Loading branch information
Showing
6 changed files
with
376 additions
and
236 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,22 @@ | ||
// ignore-order | ||
|
||
const FILTER_CRATE = "std"; | ||
|
||
const EXPECTED = [ | ||
{ | ||
'query': 'vec::intoiter<T> -> [T]', | ||
'others': [ | ||
{ 'path': 'std::vec::IntoIter', 'name': 'as_slice' }, | ||
{ 'path': 'std::vec::IntoIter', 'name': 'as_mut_slice' }, | ||
{ 'path': 'std::vec::IntoIter', 'name': 'next_chunk' }, | ||
], | ||
}, | ||
{ | ||
'query': 'vec::intoiter<T> -> []', | ||
'others': [ | ||
{ 'path': 'std::vec::IntoIter', 'name': 'as_slice' }, | ||
{ 'path': 'std::vec::IntoIter', 'name': 'as_mut_slice' }, | ||
{ 'path': 'std::vec::IntoIter', 'name': 'next_chunk' }, | ||
], | ||
}, | ||
]; |
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,38 @@ | ||
// exact-check | ||
|
||
const EXPECTED = [ | ||
{ | ||
'query': 'Inside<T> -> Out1<T>', | ||
'others': [ | ||
{ 'path': 'generics_unbox', 'name': 'alpha' }, | ||
], | ||
}, | ||
{ | ||
'query': 'Inside<T> -> Out3<T>', | ||
'others': [ | ||
{ 'path': 'generics_unbox', 'name': 'beta' }, | ||
{ 'path': 'generics_unbox', 'name': 'gamma' }, | ||
], | ||
}, | ||
{ | ||
'query': 'Inside<T> -> Out4<T>', | ||
'others': [ | ||
{ 'path': 'generics_unbox', 'name': 'beta' }, | ||
{ 'path': 'generics_unbox', 'name': 'gamma' }, | ||
], | ||
}, | ||
{ | ||
'query': 'Inside<T> -> Out3<U, T>', | ||
'others': [ | ||
{ 'path': 'generics_unbox', 'name': 'beta' }, | ||
{ 'path': 'generics_unbox', 'name': 'gamma' }, | ||
], | ||
}, | ||
{ | ||
'query': 'Inside<T> -> Out4<U, T>', | ||
'others': [ | ||
{ 'path': 'generics_unbox', 'name': 'beta' }, | ||
{ 'path': 'generics_unbox', 'name': 'gamma' }, | ||
], | ||
}, | ||
]; |
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,36 @@ | ||
pub struct Out<A, B = ()> { | ||
a: A, | ||
b: B, | ||
} | ||
|
||
pub struct Out1<A, const N: usize> { | ||
a: [A; N], | ||
} | ||
|
||
pub struct Out2<A, const N: usize> { | ||
a: [A; N], | ||
} | ||
|
||
pub struct Out3<A, B> { | ||
a: A, | ||
b: B, | ||
} | ||
|
||
pub struct Out4<A, B> { | ||
a: A, | ||
b: B, | ||
} | ||
|
||
pub struct Inside<T>(T); | ||
|
||
pub fn alpha<const N: usize, T>(_: Inside<T>) -> Out<Out1<T, N>, Out2<T, N>> { | ||
loop {} | ||
} | ||
|
||
pub fn beta<T, U>(_: Inside<T>) -> Out<Out3<T, U>, Out4<U, T>> { | ||
loop {} | ||
} | ||
|
||
pub fn gamma<T, U>(_: Inside<T>) -> Out<Out3<U, T>, Out4<T, U>> { | ||
loop {} | ||
} |