about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-10-21 10:18:54 +0200
committerRalf Jung <post@ralfj.de>2022-10-21 10:18:54 +0200
commitaa3ac2715555be874e92601b606bee69330ad153 (patch)
treec70cd1bf55ae5032280bb4a58244f4e0e67eaa86
parente5a0426bfcd64e50c1d526b558a3337389468174 (diff)
parent7cc303fbf62f6a058064fc07026231a8a5ee533f (diff)
downloadrust-aa3ac2715555be874e92601b606bee69330ad153.tar.gz
rust-aa3ac2715555be874e92601b606bee69330ad153.zip
merge rustc history
-rw-r--r--src/config/config_type.rs2
-rw-r--r--src/items.rs12
-rw-r--r--src/visitor.rs2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/config/config_type.rs b/src/config/config_type.rs
index e37ed798cb5..c5e61658ad1 100644
--- a/src/config/config_type.rs
+++ b/src/config/config_type.rs
@@ -4,7 +4,7 @@ use crate::config::options::{IgnoreList, WidthHeuristics};
 /// Trait for types that can be used in `Config`.
 pub(crate) trait ConfigType: Sized {
     /// Returns hint text for use in `Config::print_docs()`. For enum types, this is a
-    /// pipe-separated list of variants; for other types it returns "<type>".
+    /// pipe-separated list of variants; for other types it returns `<type>`.
     fn doc_hint() -> String;
 }
 
diff --git a/src/items.rs b/src/items.rs
index 8f35068e35f..a2a73f0a5fb 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -594,7 +594,7 @@ impl<'a> FmtVisitor<'a> {
             let both_type = |l: &TyOpt, r: &TyOpt| is_type(l) && is_type(r);
             let both_opaque = |l: &TyOpt, r: &TyOpt| is_opaque(l) && is_opaque(r);
             let need_empty_line = |a: &ast::AssocItemKind, b: &ast::AssocItemKind| match (a, b) {
-                (TyAlias(lty), TyAlias(rty))
+                (Type(lty), Type(rty))
                     if both_type(&lty.ty, &rty.ty) || both_opaque(&lty.ty, &rty.ty) =>
                 {
                     false
@@ -612,7 +612,7 @@ impl<'a> FmtVisitor<'a> {
             }
 
             buffer.sort_by(|(_, a), (_, b)| match (&a.kind, &b.kind) {
-                (TyAlias(lty), TyAlias(rty))
+                (Type(lty), Type(rty))
                     if both_type(&lty.ty, &rty.ty) || both_opaque(&lty.ty, &rty.ty) =>
                 {
                     a.ident.as_str().cmp(b.ident.as_str())
@@ -621,10 +621,10 @@ impl<'a> FmtVisitor<'a> {
                     a.ident.as_str().cmp(b.ident.as_str())
                 }
                 (Fn(..), Fn(..)) => a.span.lo().cmp(&b.span.lo()),
-                (TyAlias(ty), _) if is_type(&ty.ty) => Ordering::Less,
-                (_, TyAlias(ty)) if is_type(&ty.ty) => Ordering::Greater,
-                (TyAlias(..), _) => Ordering::Less,
-                (_, TyAlias(..)) => Ordering::Greater,
+                (Type(ty), _) if is_type(&ty.ty) => Ordering::Less,
+                (_, Type(ty)) if is_type(&ty.ty) => Ordering::Greater,
+                (Type(..), _) => Ordering::Less,
+                (_, Type(..)) => Ordering::Greater,
                 (Const(..), _) => Ordering::Less,
                 (_, Const(..)) => Ordering::Greater,
                 (MacCall(..), _) => Ordering::Less,
diff --git a/src/visitor.rs b/src/visitor.rs
index 7bb745eeb8b..9c3cc7820d2 100644
--- a/src/visitor.rs
+++ b/src/visitor.rs
@@ -660,7 +660,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
                     self.push_rewrite(ai.span, rewrite);
                 }
             }
-            (ast::AssocItemKind::TyAlias(ref ty_alias), _) => {
+            (ast::AssocItemKind::Type(ref ty_alias), _) => {
                 self.visit_ty_alias_kind(ty_alias, visitor_kind, ai.span);
             }
             (ast::AssocItemKind::MacCall(ref mac), _) => {