about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/adt.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-12-18 22:21:37 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-12-24 08:05:28 +1100
commit99472c7049783605444ab888a97059d0cce93a12 (patch)
tree686e31682a9d9ae7601cf22722f1b43d3efea5db /compiler/rustc_middle/src/ty/adt.rs
parentd51db05d7ee1a12ee168f2d1ccc93ccc11b216c7 (diff)
downloadrust-99472c7049783605444ab888a97059d0cce93a12.tar.gz
rust-99472c7049783605444ab888a97059d0cce93a12.zip
Remove `Session` methods that duplicate `DiagCtxt` methods.
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier
access.
Diffstat (limited to 'compiler/rustc_middle/src/ty/adt.rs')
-rw-r--r--compiler/rustc_middle/src/ty/adt.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/adt.rs b/compiler/rustc_middle/src/ty/adt.rs
index 1d9a25628b0..b95ae5881e2 100644
--- a/compiler/rustc_middle/src/ty/adt.rs
+++ b/compiler/rustc_middle/src/ty/adt.rs
@@ -470,7 +470,7 @@ impl<'tcx> AdtDef<'tcx> {
                     Some(Discr { val: b, ty })
                 } else {
                     info!("invalid enum discriminant: {:#?}", val);
-                    tcx.sess.emit_err(crate::error::ConstEvalNonIntError {
+                    tcx.dcx().emit_err(crate::error::ConstEvalNonIntError {
                         span: tcx.def_span(expr_did),
                     });
                     None
@@ -481,7 +481,7 @@ impl<'tcx> AdtDef<'tcx> {
                     ErrorHandled::Reported(..) => "enum discriminant evaluation failed",
                     ErrorHandled::TooGeneric(..) => "enum discriminant depends on generics",
                 };
-                tcx.sess.span_delayed_bug(tcx.def_span(expr_did), msg);
+                tcx.dcx().span_delayed_bug(tcx.def_span(expr_did), msg);
                 None
             }
         }