rustdoc-search: add slices and arrays to index
This indexes them as primitives with generics, so `slice<u32>` is how you search for `[u32]`, and `array<u32>` for `[u32; 1]`. A future commit will desugar the square bracket syntax to search both arrays and slices at once.
This commit is contained in:
parent
b72460fe46
commit
c4e00f7bd5
3 changed files with 109 additions and 2 deletions
16
tests/rustdoc-js/slice-array.rs
Normal file
16
tests/rustdoc-js/slice-array.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
pub struct P;
|
||||
pub struct Q;
|
||||
pub struct R<T>(T);
|
||||
|
||||
// returns test
|
||||
pub fn alef() -> &'static [R<P>] { loop {} }
|
||||
pub fn bet() -> R<[Q; 32]> { loop {} }
|
||||
|
||||
// in_args test
|
||||
pub fn alpha(_x: R<&'static [P]>) { loop {} }
|
||||
pub fn beta(_x: [R<Q>; 32]) { loop {} }
|
||||
|
||||
pub trait TraitCat {}
|
||||
pub trait TraitDog {}
|
||||
|
||||
pub fn gamma<T: TraitCat + TraitDog>(t: [T; 32]) {}
|
Loading…
Add table
Add a link
Reference in a new issue