about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/generics.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-08-06 10:17:46 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-08-16 09:07:29 +1000
commitc8098be41fa767a96cfb3665147fabf06f456be9 (patch)
treee2182b48301ad031e61d0527f91792750a0fcc04 /compiler/rustc_parse/src/parser/generics.rs
parent55906aa2407b10b4f910c221be6f40e549780bb8 (diff)
downloadrust-c8098be41fa767a96cfb3665147fabf06f456be9.tar.gz
rust-c8098be41fa767a96cfb3665147fabf06f456be9.zip
Convert a bool to `Trailing`.
This pre-existing type is suitable for use with the return value of the
`f` parameter in `collect_tokens_trailing_token`. The more descriptive
name will be useful because the next commit will add another boolean
value to the return value of `f`.
Diffstat (limited to 'compiler/rustc_parse/src/parser/generics.rs')
-rw-r--r--compiler/rustc_parse/src/parser/generics.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_parse/src/parser/generics.rs b/compiler/rustc_parse/src/parser/generics.rs
index f1bb7187e2f..47b801d1490 100644
--- a/compiler/rustc_parse/src/parser/generics.rs
+++ b/compiler/rustc_parse/src/parser/generics.rs
@@ -7,7 +7,7 @@ use rustc_span::symbol::{kw, Ident};
 use rustc_span::Span;
 use thin_vec::ThinVec;
 
-use super::{ForceCollect, Parser};
+use super::{ForceCollect, Parser, Trailing};
 use crate::errors::{
     self, MultipleWhereClauses, UnexpectedDefaultValueForLifetimeInGenericParameters,
     UnexpectedSelfInGenericParameters, WhereClauseBeforeTupleStructBody,
@@ -228,13 +228,13 @@ impl<'a> Parser<'a> {
                                     span: where_predicate.span(),
                                 });
                                 // FIXME - try to continue parsing other generics?
-                                return Ok((None, false));
+                                return Ok((None, Trailing::No));
                             }
                             Err(err) => {
                                 err.cancel();
                                 // FIXME - maybe we should overwrite 'self' outside of `collect_tokens`?
                                 this.restore_snapshot(snapshot);
-                                return Ok((None, false));
+                                return Ok((None, Trailing::No));
                             }
                         }
                     } else {
@@ -248,14 +248,14 @@ impl<'a> Parser<'a> {
                                     .emit_err(errors::AttrWithoutGenerics { span: attrs[0].span });
                             }
                         }
-                        return Ok((None, false));
+                        return Ok((None, Trailing::No));
                     };
 
                     if !this.eat(&token::Comma) {
                         done = true;
                     }
                     // We just ate the comma, so no need to capture the trailing token.
-                    Ok((param, false))
+                    Ok((param, Trailing::No))
                 })?;
 
             if let Some(param) = param {