diff --git a/src/visitor.rs b/src/visitor.rs index 96327ef96a7..650bb40ca17 100644 --- a/src/visitor.rs +++ b/src/visitor.rs @@ -389,9 +389,9 @@ impl<'a> FmtVisitor<'a> { ti.id, ast::Defaultness::Final); } - ast::TraitItemKind::Type(ref type_param_bounds, _) => { + ast::TraitItemKind::Type(ref type_param_bounds, ref type_default) => { let rewrite = rewrite_associated_type(ti.ident, - None, + type_default.as_ref(), Some(type_param_bounds), &self.get_context(), self.block_indent); diff --git a/tests/target/associated_type_defaults.rs b/tests/target/associated_type_defaults.rs new file mode 100644 index 00000000000..d0a08133725 --- /dev/null +++ b/tests/target/associated_type_defaults.rs @@ -0,0 +1,4 @@ +#![feature(associated_type_defaults)] +trait Foo { + type Bar = (); +}