|
1 | 1 | use crate::expr::Expr;
|
2 |
| -#[cfg(feature = "parsing")] |
3 | 2 | use crate::generics::TypeParamBound;
|
4 |
| -#[cfg(feature = "parsing")] |
5 | 3 | use crate::path::{Path, PathArguments};
|
6 |
| -#[cfg(feature = "parsing")] |
7 | 4 | use crate::punctuated::Punctuated;
|
8 |
| -#[cfg(feature = "parsing")] |
9 | 5 | use crate::ty::{ReturnType, Type};
|
10 |
| -#[cfg(feature = "parsing")] |
11 | 6 | use proc_macro2::{Delimiter, TokenStream, TokenTree};
|
12 |
| -#[cfg(feature = "parsing")] |
13 | 7 | use std::ops::ControlFlow;
|
14 | 8 |
|
15 | 9 | pub(crate) fn requires_terminator(expr: &Expr) -> bool {
|
@@ -57,7 +51,6 @@ pub(crate) fn requires_terminator(expr: &Expr) -> bool {
|
57 | 51 | }
|
58 | 52 |
|
59 | 53 | /// Whether the expression's last token is `}`.
|
60 |
| -#[cfg(feature = "parsing")] |
61 | 54 | pub(crate) fn expr_trailing_brace(mut expr: &Expr) -> bool {
|
62 | 55 | loop {
|
63 | 56 | match expr {
|
@@ -116,7 +109,6 @@ pub(crate) fn expr_trailing_brace(mut expr: &Expr) -> bool {
|
116 | 109 | }
|
117 | 110 | }
|
118 | 111 |
|
119 |
| -#[cfg(feature = "parsing")] |
120 | 112 | fn type_trailing_brace(mut ty: &Type) -> bool {
|
121 | 113 | fn last_type_in_path(path: &Path) -> Option<&Type> {
|
122 | 114 | match &path.segments.last().unwrap().arguments {
|
@@ -174,7 +166,6 @@ fn type_trailing_brace(mut ty: &Type) -> bool {
|
174 | 166 | }
|
175 | 167 | }
|
176 | 168 |
|
177 |
| -#[cfg(feature = "parsing")] |
178 | 169 | fn tokens_trailing_brace(tokens: &TokenStream) -> bool {
|
179 | 170 | if let Some(TokenTree::Group(last)) = tokens.clone().into_iter().last() {
|
180 | 171 | last.delimiter() == Delimiter::Brace
|
|
0 commit comments