diff options
| author | dianqk <dianqk@dianqk.net> | 2025-06-08 15:30:18 +0800 |
|---|---|---|
| committer | dianqk <dianqk@dianqk.net> | 2025-06-29 20:13:36 +0800 |
| commit | 9f9cd5e2837f57504b92b5acbadb48ff0cb9e29c (patch) | |
| tree | 40909c9f107775e415bed62051fe9d757c647ad5 /compiler/rustc_mir_build/src/builder/custom | |
| parent | 5ca574e85b67cec0a6fc3fddfe398cbe676c9c69 (diff) | |
| download | rust-9f9cd5e2837f57504b92b5acbadb48ff0cb9e29c.tar.gz rust-9f9cd5e2837f57504b92b5acbadb48ff0cb9e29c.zip | |
mir: Add a `new` method to `statement`
Avoid introducing a large number of changes when adding optional initialization fields.
Diffstat (limited to 'compiler/rustc_mir_build/src/builder/custom')
| -rw-r--r-- | compiler/rustc_mir_build/src/builder/custom/parse.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_mir_build/src/builder/custom/parse.rs b/compiler/rustc_mir_build/src/builder/custom/parse.rs index 91e284604b6..10154461c33 100644 --- a/compiler/rustc_mir_build/src/builder/custom/parse.rs +++ b/compiler/rustc_mir_build/src/builder/custom/parse.rs @@ -315,10 +315,8 @@ impl<'a, 'tcx> ParseCtxt<'a, 'tcx> { let stmt = self.statement_as_expr(*stmt_id)?; let span = self.thir[stmt].span; let statement = self.parse_statement(stmt)?; - data.statements.push(Statement { - source_info: SourceInfo { span, scope: self.source_scope }, - kind: statement, - }); + data.statements + .push(Statement::new(SourceInfo { span, scope: self.source_scope }, statement)); } let Some(trailing) = block.expr else { return Err(self.expr_error(expr_id, "terminator")) }; |
