diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-18 22:21:37 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-24 08:05:28 +1100 |
| commit | 99472c7049783605444ab888a97059d0cce93a12 (patch) | |
| tree | 686e31682a9d9ae7601cf22722f1b43d3efea5db /compiler/rustc_hir_analysis/src/coherence/mod.rs | |
| parent | d51db05d7ee1a12ee168f2d1ccc93ccc11b216c7 (diff) | |
| download | rust-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_hir_analysis/src/coherence/mod.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/coherence/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_hir_analysis/src/coherence/mod.rs b/compiler/rustc_hir_analysis/src/coherence/mod.rs index fc8fab0eabc..5cc9da25d6a 100644 --- a/compiler/rustc_hir_analysis/src/coherence/mod.rs +++ b/compiler/rustc_hir_analysis/src/coherence/mod.rs @@ -46,7 +46,7 @@ fn enforce_trait_manually_implementable( if tcx.trait_def(trait_def_id).deny_explicit_impl { let trait_name = tcx.item_name(trait_def_id); let mut err = struct_span_err!( - tcx.sess, + tcx.dcx(), impl_header_span, E0322, "explicit impls for the `{trait_name}` trait are not permitted" @@ -67,7 +67,7 @@ fn enforce_trait_manually_implementable( tcx.trait_def(trait_def_id).specialization_kind { if !tcx.features().specialization && !tcx.features().min_specialization { - tcx.sess.emit_err(errors::SpecializationTrait { span: impl_header_span }); + tcx.dcx().emit_err(errors::SpecializationTrait { span: impl_header_span }); return; } } @@ -89,7 +89,7 @@ fn enforce_empty_impls_for_marker_traits( } struct_span_err!( - tcx.sess, + tcx.dcx(), tcx.def_span(impl_def_id), E0715, "impls for marker traits cannot contain items" @@ -174,7 +174,7 @@ fn check_object_overlap<'tcx>( if supertrait_def_ids.any(|d| d == trait_def_id) { let span = tcx.def_span(impl_def_id); struct_span_err!( - tcx.sess, + tcx.dcx(), span, E0371, "the object type `{}` automatically implements the trait `{}`", |
