diff options
| author | bors <bors@rust-lang.org> | 2023-06-02 05:11:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-06-02 05:11:49 +0000 |
| commit | 33c3d101280c8eb3cd8af421bfb56a8afcc3881d (patch) | |
| tree | 2e65db5c7568d3a9220cca76dec79c036a97d749 /compiler/rustc_passes | |
| parent | 774a3d1523bde3a16f8a92dbaac01d211ba911c3 (diff) | |
| parent | f6c2bc5c24fd08200c0e4438d981ca58dc71f488 (diff) | |
| download | rust-33c3d101280c8eb3cd8af421bfb56a8afcc3881d.tar.gz rust-33c3d101280c8eb3cd8af421bfb56a8afcc3881d.zip | |
Auto merge of #111677 - fee1-dead-contrib:rustc_const_eval-translatable, r=oli-obk,RalfJung
Use translatable diagnostics in `rustc_const_eval` This PR: * adds a `no_span` parameter to `note` / `help` attributes when using `Subdiagnostic` to allow adding notes/helps without using a span * has minor tweaks and changes to error messages
Diffstat (limited to 'compiler/rustc_passes')
| -rw-r--r-- | compiler/rustc_passes/src/layout_test.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_passes/src/layout_test.rs b/compiler/rustc_passes/src/layout_test.rs index 5a1ae808e66..9971bdf45bb 100644 --- a/compiler/rustc_passes/src/layout_test.rs +++ b/compiler/rustc_passes/src/layout_test.rs @@ -93,7 +93,7 @@ fn dump_layout_of(tcx: TyCtxt<'_>, item_def_id: LocalDefId, attr: &Attribute) { Err(layout_error) => { tcx.sess.emit_fatal(Spanned { - node: layout_error, + node: layout_error.into_diagnostic(), span: tcx.def_span(item_def_id.to_def_id()), }); } @@ -109,12 +109,7 @@ impl<'tcx> LayoutOfHelpers<'tcx> for UnwrapLayoutCx<'tcx> { type LayoutOfResult = TyAndLayout<'tcx>; fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! { - span_bug!( - span, - "`#[rustc_layout(..)]` test resulted in `layout_of({}) = Err({})`", - ty, - err - ); + span_bug!(span, "`#[rustc_layout(..)]` test resulted in `layout_of({ty}) = Err({err})`",); } } |
