diff options
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/intrinsic.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/intrinsic.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs index 126bab68ae3..632af780ed8 100644 --- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs +++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs @@ -29,7 +29,7 @@ fn equate_intrinsic_type<'tcx>( (own_counts, generics.span) } _ => { - struct_span_err!(tcx.sess, it.span, E0622, "intrinsic must be a function") + struct_span_err!(tcx.dcx(), it.span, E0622, "intrinsic must be a function") .span_label(it.span, "expected a function") .emit(); return; @@ -38,7 +38,7 @@ fn equate_intrinsic_type<'tcx>( let gen_count_ok = |found: usize, expected: usize, descr: &str| -> bool { if found != expected { - tcx.sess.emit_err(WrongNumberOfGenericArgumentsToIntrinsic { + tcx.dcx().emit_err(WrongNumberOfGenericArgumentsToIntrinsic { span, found, expected, @@ -117,7 +117,7 @@ pub fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: DefId) -> hir }; if has_safe_attr != is_in_list { - tcx.sess.struct_span_err( + tcx.dcx().struct_span_err( tcx.def_span(intrinsic_id), DiagnosticMessage::from(format!( "intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `{}`", @@ -176,7 +176,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) { | "umin" => (1, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], param(0)), "fence" | "singlethreadfence" => (0, Vec::new(), Ty::new_unit(tcx)), op => { - tcx.sess.emit_err(UnrecognizedAtomicOperation { span: it.span, op }); + tcx.dcx().emit_err(UnrecognizedAtomicOperation { span: it.span, op }); return; } }; @@ -460,7 +460,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) { } other => { - tcx.sess.emit_err(UnrecognizedIntrinsicFunction { span: it.span, name: other }); + tcx.dcx().emit_err(UnrecognizedIntrinsicFunction { span: it.span, name: other }); return; } }; @@ -552,7 +552,7 @@ pub fn check_platform_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) sym::simd_shuffle_generic => (2, 1, vec![param(0), param(0)], param(1)), _ => { let msg = format!("unrecognized platform-specific intrinsic function: `{name}`"); - tcx.sess.struct_span_err(it.span, msg).emit(); + tcx.dcx().struct_span_err(it.span, msg).emit(); return; } }; |
