about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/transform
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-12-17 11:24:34 +0100
committerRalf Jung <post@ralfj.de>2024-01-22 09:28:00 +0100
commit0288a0bfa0f038350aaae224b6cdd7e440ea8408 (patch)
treea17fb47acdff7992518684e27295e081418bed4f /compiler/rustc_const_eval/src/transform
parent2f1a8e2d7a641a398e9e02c8c99e80f6e44dce87 (diff)
downloadrust-0288a0bfa0f038350aaae224b6cdd7e440ea8408.tar.gz
rust-0288a0bfa0f038350aaae224b6cdd7e440ea8408.zip
raw pointers are not references
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/ops.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
index 327c91731bf..39bc2b960e9 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
@@ -466,7 +466,7 @@ impl<'tcx> NonConstOp<'tcx> for MutBorrow {
 
     fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {
         match self.0 {
-            hir::BorrowKind::Raw => ccx.dcx().create_err(errors::UnallowedMutableRefsRaw {
+            hir::BorrowKind::Raw => ccx.tcx.dcx().create_err(errors::UnallowedMutableRaw {
                 span,
                 kind: ccx.const_kind(),
                 teach: ccx.tcx.sess.teach(&error_code!(E0764)).then_some(()),
@@ -491,10 +491,10 @@ impl<'tcx> NonConstOp<'tcx> for TransientMutBorrow {
     fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {
         let kind = ccx.const_kind();
         match self.0 {
-            hir::BorrowKind::Raw => ccx.tcx.sess.create_feature_err(
-                errors::TransientMutBorrowErrRaw { span, kind },
-                sym::const_mut_refs,
-            ),
+            hir::BorrowKind::Raw => ccx
+                .tcx
+                .sess
+                .create_feature_err(errors::TransientMutRawErr { span, kind }, sym::const_mut_refs),
             hir::BorrowKind::Ref => ccx.tcx.sess.create_feature_err(
                 errors::TransientMutBorrowErr { span, kind },
                 sym::const_mut_refs,