mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
rustdoc: add note about slice/array searches to help popup
This commit is contained in:
parent
7a1154e159
commit
d3a4cd6813
@ -1077,6 +1077,10 @@ function preLoadCss(cssUrl) {
|
||||
<code>-> vec</code> or <code>String, enum:Cow -> bool</code>)",
|
||||
"You can look for items with an exact name by putting double quotes around \
|
||||
your request: <code>\"string\"</code>",
|
||||
"Look for functions that accept or return \
|
||||
<a href=\"https://doc.rust-lang.org/std/primitive.slice.html\">slices</a> and \
|
||||
<a href=\"https://doc.rust-lang.org/std/primitive.array.html\">arrays</a> by writing \
|
||||
square brackets (e.g., <code>-> [u8]</code> or <code>[] -> Option</code>)",
|
||||
"Look for items inside another one by searching for a path: <code>vec::Vec</code>",
|
||||
].map(x => "<p>" + x + "</p>").join("");
|
||||
const div_infos = document.createElement("div");
|
||||
|
@ -1,9 +1,8 @@
|
||||
// exact-match
|
||||
|
||||
// https://github.com/rust-lang/rust/issues/60485#issuecomment-663900624
|
||||
const QUERY = 'OsString -> String';
|
||||
|
||||
const EXPECTED = {
|
||||
'query': 'OsString -> String',
|
||||
'others': [
|
||||
{ 'path': 'std::ffi::OsString', 'name': 'into_string' },
|
||||
]
|
||||
|
@ -1,24 +1,6 @@
|
||||
const QUERY = [
|
||||
'[[[D, []]]',
|
||||
'[[[D, []]]]',
|
||||
'[] u8',
|
||||
'[u8]',
|
||||
'[u8,u8]',
|
||||
'[u8<u8>]',
|
||||
'[]',
|
||||
'[>',
|
||||
'[<',
|
||||
'[a>',
|
||||
'[a<',
|
||||
'[a',
|
||||
'[',
|
||||
']',
|
||||
'primitive:[u8]',
|
||||
'macro:[u8]',
|
||||
];
|
||||
|
||||
const PARSED = [
|
||||
{
|
||||
query: '[[[D, []]]',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: '[[[D, []]]',
|
||||
@ -27,6 +9,7 @@ const PARSED = [
|
||||
error: 'Unclosed `[`',
|
||||
},
|
||||
{
|
||||
query: '[[[D, []]]]',
|
||||
elems: [
|
||||
{
|
||||
name: "[]",
|
||||
@ -79,6 +62,7 @@ const PARSED = [
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '[] u8',
|
||||
elems: [
|
||||
{
|
||||
name: "[]",
|
||||
@ -104,6 +88,7 @@ const PARSED = [
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '[u8]',
|
||||
elems: [
|
||||
{
|
||||
name: "[]",
|
||||
@ -130,6 +115,7 @@ const PARSED = [
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '[u8,u8]',
|
||||
elems: [
|
||||
{
|
||||
name: "[]",
|
||||
@ -164,6 +150,7 @@ const PARSED = [
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '[u8<u8>]',
|
||||
elems: [
|
||||
{
|
||||
name: "[]",
|
||||
@ -199,6 +186,7 @@ const PARSED = [
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '[]',
|
||||
elems: [
|
||||
{
|
||||
name: "[]",
|
||||
@ -216,6 +204,7 @@ const PARSED = [
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '[>',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "[>",
|
||||
@ -224,6 +213,7 @@ const PARSED = [
|
||||
error: "Unexpected `>` after `[`",
|
||||
},
|
||||
{
|
||||
query: '[<',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "[<",
|
||||
@ -232,6 +222,7 @@ const PARSED = [
|
||||
error: "Found generics without a path",
|
||||
},
|
||||
{
|
||||
query: '[a>',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "[a>",
|
||||
@ -240,6 +231,7 @@ const PARSED = [
|
||||
error: "Unexpected `>` after `[`",
|
||||
},
|
||||
{
|
||||
query: '[a<',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "[a<",
|
||||
@ -248,6 +240,7 @@ const PARSED = [
|
||||
error: "Unclosed `<`",
|
||||
},
|
||||
{
|
||||
query: '[a',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "[a",
|
||||
@ -256,6 +249,7 @@ const PARSED = [
|
||||
error: "Unclosed `[`",
|
||||
},
|
||||
{
|
||||
query: '[',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "[",
|
||||
@ -264,6 +258,7 @@ const PARSED = [
|
||||
error: "Unclosed `[`",
|
||||
},
|
||||
{
|
||||
query: ']',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "]",
|
||||
@ -272,6 +267,7 @@ const PARSED = [
|
||||
error: "Unexpected `]`",
|
||||
},
|
||||
{
|
||||
query: 'primitive:[u8]',
|
||||
elems: [
|
||||
{
|
||||
name: "[]",
|
||||
@ -298,6 +294,7 @@ const PARSED = [
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: 'macro:[u8]',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "macro:[u8]",
|
||||
|
@ -52,7 +52,7 @@ const EXPECTED = [
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '[TraitDog]',
|
||||
'query': '[TraitCat]',
|
||||
'in_args': [
|
||||
{ 'path': 'slice_array', 'name': 'gamma' },
|
||||
{ 'path': 'slice_array', 'name': 'epsilon' },
|
||||
|
Loading…
Reference in New Issue
Block a user