values: inputs.clean(cx),
},
output: self.decl.output.clean(cx),
+ variadic: false,
attrs: Vec::new()
};
Method {
values: inputs.clean(cx),
},
output: self.decl.output.clean(cx),
+ variadic: false,
attrs: Vec::new()
};
TyMethod {
pub struct FnDecl {
pub inputs: Arguments,
pub output: FunctionRetTy,
+ pub variadic: bool,
pub attrs: Vec<Attribute>,
}
values: self.inputs.clean(cx),
},
output: self.output.clean(cx),
+ variadic: self.variadic,
attrs: Vec::new()
}
}
FnDecl {
output: Return(sig.0.output.clean(cx)),
attrs: Vec::new(),
+ variadic: sig.0.variadic,
inputs: Arguments {
values: sig.0.inputs.iter().map(|t| {
Argument {
impl fmt::Display for clean::FnDecl {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "({args}){arrow}", args = self.inputs, arrow = self.output)
+ if self.variadic {
+ write!(f, "({args}, ...){arrow}", args = self.inputs, arrow = self.output)
+ } else {
+ write!(f, "({args}){arrow}", args = self.inputs, arrow = self.output)
+ }
}
}
--- /dev/null
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern "C" {
+ // @has variadic/fn.foo.html //pre 'pub unsafe extern fn foo(x: i32, ...)'
+ pub fn foo(x: i32, ...);
+}