提交 6562eeb0 编写于 作者: A Aaron Turon

Add pretty printer output for `default`

上级 dc45d924
......@@ -1014,6 +1014,11 @@ pub fn print_impl_item(&mut self, ii: &hir::ImplItem) -> io::Result<()> {
try!(self.hardbreak_if_not_bol());
try!(self.maybe_print_comment(ii.span.lo));
try!(self.print_outer_attributes(&ii.attrs));
if let hir::Defaultness::Default = ii.defaultness {
try!(self.word_nbsp("default"));
}
match ii.node {
hir::ImplItemKind::Const(ref ty, ref expr) => {
try!(self.print_associated_const(ii.name, &ty, Some(&expr), ii.vis));
......
......@@ -1582,6 +1582,9 @@ pub fn print_impl_item(&mut self, ii: &ast::ImplItem) -> io::Result<()> {
try!(self.hardbreak_if_not_bol());
try!(self.maybe_print_comment(ii.span.lo));
try!(self.print_outer_attributes(&ii.attrs));
if let ast::Defaultness::Default = ii.defaultness {
try!(self.word_nbsp("default"));
}
match ii.node {
ast::ImplItemKind::Const(ref ty, ref expr) => {
try!(self.print_associated_const(ii.ident, &ty, Some(&expr), ii.vis));
......
......@@ -63,7 +63,8 @@ fn bar(&self) -> i32 { 0 }
// / \
// Vec<i32> $Vec<i64>
impl<T> Bar for T {} // use the provided method
// use the provided method
impl<T> Bar for T {}
impl Bar for i32 {
fn bar(&self) -> i32 { 1 }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册