diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-11-23 11:55:16 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-02-21 11:51:56 +1100 |
| commit | af75a2f7f10001da3f9d5fbda2d9cce458b7959d (patch) | |
| tree | 07d52e833a97486ae8db0aae1fec4b657846082e | |
| parent | 24f4ecec2595ab504994766d8cc60d2c11eaa369 (diff) | |
| download | rust-af75a2f7f10001da3f9d5fbda2d9cce458b7959d.tar.gz rust-af75a2f7f10001da3f9d5fbda2d9cce458b7959d.zip | |
Use `ThinVec` in various AST types.
This commit changes the sequence parsers to produce `ThinVec`, which triggers numerous conversions.
| -rw-r--r-- | src/chains.rs | 4 | ||||
| -rw-r--r-- | src/lib.rs | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/chains.rs b/src/chains.rs index 39b8d687809..cbe523c6c3c 100644 --- a/src/chains.rs +++ b/src/chains.rs @@ -74,6 +74,8 @@ use crate::utils::{ rewrite_ident, trimmed_last_line_width, wrap_str, }; +use thin_vec::ThinVec; + /// Provides the original input contents from the span /// of a chain element with trailing spaces trimmed. fn format_overflow_style(span: Span, context: &RewriteContext<'_>) -> Option<String> { @@ -168,7 +170,7 @@ enum ChainItemKind { MethodCall( ast::PathSegment, Vec<ast::GenericArg>, - Vec<ptr::P<ast::Expr>>, + ThinVec<ptr::P<ast::Expr>>, ), StructField(symbol::Ident), TupleField(symbol::Ident, bool), diff --git a/src/lib.rs b/src/lib.rs index 0c27bcacfb8..b27405efdb7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,7 @@ extern crate rustc_expand; extern crate rustc_parse; extern crate rustc_session; extern crate rustc_span; +extern crate thin_vec; // Necessary to pull in object code as the rest of the rustc crates are shipped only as rmeta // files. |
