Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/rustdoc-json-types/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,10 @@ pub struct FunctionPointer {

#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct FnDecl {
/// List of argument names and their type.
///
/// Note that not all names will be valid identifiers, as some of
/// them may be patterns.
pub inputs: Vec<(String, Type)>,
pub output: Option<Type>,
pub c_variadic: bool,
Expand Down
7 changes: 7 additions & 0 deletions src/test/rustdoc-json/fns/pattern_arg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// @is "$.index[*][?(@.name=='fst')].inner.decl.inputs[0][0]" '"(x, _)"'
pub fn fst<X, Y>((x, _): (X, Y)) -> X {
x
}

// @is "$.index[*][?(@.name=='drop_int')].inner.decl.inputs[0][0]" '"_"'
pub fn drop_int(_: i32) {}