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 | 4143b101f9b0949c4bc6db1124f86ef02b1ef7aa (patch) | |
| tree | ccec1e793829bc4ce4095fc02cc647ba8b6f63f2 /src/tools/rustfmt | |
| parent | 6a56c3a930733b7e000cc3ec54844b0522a8bd16 (diff) | |
| download | rust-4143b101f9b0949c4bc6db1124f86ef02b1ef7aa.tar.gz rust-4143b101f9b0949c4bc6db1124f86ef02b1ef7aa.zip | |
Use `ThinVec` in various AST types.
This commit changes the sequence parsers to produce `ThinVec`, which triggers numerous conversions.
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/chains.rs | 4 | ||||
| -rw-r--r-- | src/tools/rustfmt/src/lib.rs | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/rustfmt/src/chains.rs b/src/tools/rustfmt/src/chains.rs index 39b8d687809..cbe523c6c3c 100644 --- a/src/tools/rustfmt/src/chains.rs +++ b/src/tools/rustfmt/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/tools/rustfmt/src/lib.rs b/src/tools/rustfmt/src/lib.rs index 0c27bcacfb8..b27405efdb7 100644 --- a/src/tools/rustfmt/src/lib.rs +++ b/src/tools/rustfmt/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. |
