Skip to content

Commit

Permalink
Reorder GenericArgument::Const next to Type
Browse files Browse the repository at this point in the history
Now that const generics were stabilized.
  • Loading branch information
dtolnay committed Sep 18, 2022
1 parent be1b758 commit e3d6e7b
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/gen/clone.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/gen/debug.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/gen/eq.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/gen/fold.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/gen/hash.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/gen/visit.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/gen/visit_mut.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ ast_enum! {
Lifetime(Lifetime),
/// A type argument.
Type(Type),
/// A binding (equality constraint) on an associated type: the `Item =
/// u8` in `Iterator<Item = u8>`.
Binding(Binding),
/// An associated type bound: `Iterator<Item: Display>`.
Constraint(Constraint),
/// A const expression. Must be inside of a block.
///
/// NOTE: Identity expressions are represented as Type arguments, as
/// they are indistinguishable syntactically.
Const(Expr),
/// A binding (equality constraint) on an associated type: the `Item =
/// u8` in `Iterator<Item = u8>`.
Binding(Binding),
/// An associated type bound: `Iterator<Item: Display>`.
Constraint(Constraint),
}
}

Expand Down Expand Up @@ -729,8 +729,6 @@ pub(crate) mod printing {
match self {
GenericArgument::Lifetime(lt) => lt.to_tokens(tokens),
GenericArgument::Type(ty) => ty.to_tokens(tokens),
GenericArgument::Binding(tb) => tb.to_tokens(tokens),
GenericArgument::Constraint(tc) => tc.to_tokens(tokens),
GenericArgument::Const(e) => match *e {
Expr::Lit(_) => e.to_tokens(tokens),

Expand All @@ -746,6 +744,8 @@ pub(crate) mod printing {
e.to_tokens(tokens);
}),
},
GenericArgument::Binding(tb) => tb.to_tokens(tokens),
GenericArgument::Constraint(tc) => tc.to_tokens(tokens),
}
}
}
Expand All @@ -766,17 +766,17 @@ pub(crate) mod printing {
trailing_or_empty = param.punct().is_some();
}
GenericArgument::Type(_)
| GenericArgument::Const(_)
| GenericArgument::Binding(_)
| GenericArgument::Constraint(_)
| GenericArgument::Const(_) => {}
| GenericArgument::Constraint(_) => {}
}
}
for param in self.args.pairs() {
match **param.value() {
GenericArgument::Type(_)
| GenericArgument::Const(_)
| GenericArgument::Binding(_)
| GenericArgument::Constraint(_)
| GenericArgument::Const(_) => {
| GenericArgument::Constraint(_) => {
if !trailing_or_empty {
<Token![,]>::default().to_tokens(tokens);
}
Expand Down
10 changes: 5 additions & 5 deletions syn.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions tests/debug/gen.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e3d6e7b

Please sign in to comment.