Allow default associated types

This commit is contained in:
topecongiro 2017-05-26 17:17:12 +09:00
parent b43958d96e
commit fcffe854b8
2 changed files with 6 additions and 2 deletions

View File

@ -389,9 +389,9 @@ pub fn visit_trait_item(&mut self, ti: &ast::TraitItem) {
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);

View File

@ -0,0 +1,4 @@
#![feature(associated_type_defaults)]
trait Foo {
type Bar = ();
}