]> git.lizzy.rs Git - rust.git/blobdiff - src/visitor.rs
Remove BlockIndentStyle::Inherit
[rust.git] / src / visitor.rs
index 1344121b5a6982151032bde59753d73f5748966a..2700287608de6f1944a3648c4f0fcdd5367fb476 100644 (file)
@@ -21,7 +21,8 @@
 use rewrite::{Rewrite, RewriteContext};
 use comment::rewrite_comment;
 use macros::{rewrite_macro, MacroPosition};
-use items::{rewrite_static, rewrite_associated_type, rewrite_type_alias, format_impl, format_trait};
+use items::{rewrite_static, rewrite_associated_type, rewrite_associated_impl_type,
+            rewrite_type_alias, format_impl, format_trait};
 
 fn is_use_item(item: &ast::Item) -> bool {
     match item.node {
@@ -411,11 +412,12 @@ pub fn visit_impl_item(&mut self, ii: &ast::ImplItem) {
                 self.push_rewrite(ii.span, rewrite);
             }
             ast::ImplItemKind::Type(ref ty) => {
-                let rewrite = rewrite_associated_type(ii.ident,
-                                                      Some(ty),
-                                                      None,
-                                                      &self.get_context(),
-                                                      self.block_indent);
+                let rewrite = rewrite_associated_impl_type(ii.ident,
+                                                           ii.defaultness,
+                                                           Some(ty),
+                                                           None,
+                                                           &self.get_context(),
+                                                           self.block_indent);
                 self.push_rewrite(ii.span, rewrite);
             }
             ast::ImplItemKind::Macro(ref mac) => {
@@ -592,7 +594,7 @@ fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
                     let comment = try_opt!(rewrite_comment(comment,
                                                            false,
                                                            Shape::legacy(context.config
-                                                                             .ideal_width -
+                                                                             .comment_width -
                                                                          shape.indent.width(),
                                                                          shape.indent),
                                                            context.config));
@@ -608,7 +610,7 @@ fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
             if a_str.starts_with("//") {
                 a_str = try_opt!(rewrite_comment(&a_str,
                                                  false,
-                                                 Shape::legacy(context.config.ideal_width -
+                                                 Shape::legacy(context.config.comment_width -
                                                                shape.indent.width(),
                                                                shape.indent),
                                                  context.config));