Add pretty printer output for default
This commit is contained in:
parent
dc45d924b6
commit
6562eeb053
@ -1014,6 +1014,11 @@ impl<'a> State<'a> {
|
||||
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 @@ impl<'a> State<'a> {
|
||||
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 @@ trait Bar {
|
||||
// / \
|
||||
// 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 }
|
||||
|
Loading…
x
Reference in New Issue
Block a user