diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index ffcd22fa82096..975b4d3636f2d 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -122,7 +122,7 @@ r##"

Search functions by type signature (e.g. - vec -> usize) + vec -> usize or * -> vec)

diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 8844ed82bb5e2..08f70ae9ce7a0 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -280,7 +280,7 @@ var parts = val.split("->").map(trimmer); var input = parts[0]; // sort inputs so that order does not matter - var inputs = input.split(",").map(trimmer).sort(); + var inputs = input.split(",").map(trimmer).sort().toString(); var output = parts[1]; for (var i = 0; i < nSearchWords; ++i) { @@ -296,8 +296,8 @@ // allow searching for void (no output) functions as well var typeOutput = type.output ? type.output.name : ""; - if (inputs.toString() === typeInputs.toString() && - output == typeOutput) { + if ((inputs === "*" || inputs === typeInputs.toString()) && + (output === "*" || output == typeOutput)) { results.push({id: i, index: -1, dontValidate: true}); } }