diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-02 14:30:37 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-03 09:02:50 +1100 |
| commit | 0621cd46f2ee2711cf2f808521629d223fda8d54 (patch) | |
| tree | f68130d1dec53f3d5790550faf07ed3807abd9c4 /compiler/rustc_session/src | |
| parent | b506cce5792d543cf5ffa828f539c950b9739b2c (diff) | |
| download | rust-0621cd46f2ee2711cf2f808521629d223fda8d54.tar.gz rust-0621cd46f2ee2711cf2f808521629d223fda8d54.zip | |
Simplify future breakage control flow.
`emit_future_breakage` calls `self.dcx().take_future_breakage_diagnostics()` and then passes the result to `self.dcx().emit_future_breakage_report(diags)`. This commit removes the first of these and lets `emit_future_breakage_report` do the taking. It also inlines and removes what is left of `emit_future_breakage`, which has a single call site.
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 3a0ae74dd92..f6af5a4f87e 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -288,19 +288,9 @@ impl Session { pub fn finish_diagnostics(&self, registry: &Registry) { self.check_miri_unleashed_features(); self.dcx().print_error_count(registry); - self.emit_future_breakage(); - } - - fn emit_future_breakage(&self) { - if !self.opts.json_future_incompat { - return; - } - - let diags = self.dcx().take_future_breakage_diagnostics(); - if diags.is_empty() { - return; + if self.opts.json_future_incompat { + self.dcx().emit_future_breakage_report(); } - self.dcx().emit_future_breakage_report(diags); } /// Returns true if the crate is a testing one. |
