Fix a test.

This commit is contained in:
Nicholas Nethercote 2023-02-21 10:24:51 +11:00
parent c7f443a6e3
commit 9c7570b429

View File

@ -41,7 +41,7 @@
use rustc_span::source_map::FilePathMapping; use rustc_span::source_map::FilePathMapping;
use rustc_span::source_map::{FileName, Spanned, DUMMY_SP}; use rustc_span::source_map::{FileName, Spanned, DUMMY_SP};
use rustc_span::symbol::Ident; use rustc_span::symbol::Ident;
use thin_vec::thin_vec; use thin_vec::{thin_vec, ThinVec};
fn parse_expr(ps: &ParseSess, src: &str) -> Option<P<Expr>> { fn parse_expr(ps: &ParseSess, src: &str) -> Option<P<Expr>> {
let src_as_string = src.to_string(); let src_as_string = src.to_string();
@ -111,7 +111,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
} }
10 => { 10 => {
let block = P(Block { let block = P(Block {
stmts: Vec::new(), stmts: ThinVec::new(),
id: DUMMY_NODE_ID, id: DUMMY_NODE_ID,
rules: BlockCheckMode::Default, rules: BlockCheckMode::Default,
span: DUMMY_SP, span: DUMMY_SP,
@ -165,7 +165,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
g(ExprKind::Struct(P(StructExpr { g(ExprKind::Struct(P(StructExpr {
qself: None, qself: None,
path, path,
fields: vec![], fields: thin_vec![],
rest: StructRest::Base(make_x()), rest: StructRest::Base(make_x()),
}))); })));
} }