diff options
| author | Frank King <frankking1729@gmail.com> | 2025-01-19 22:01:11 +0800 |
|---|---|---|
| committer | Frank King <frankking1729@gmail.com> | 2025-06-15 10:21:29 +0800 |
| commit | e627f88f88de85cc52ff1c99a076909084806c98 (patch) | |
| tree | 0f53bd1e6bef6c79ada367f0a6ca8c7ac6eb2f93 /compiler/rustc_const_eval/src/check_consts/ops.rs | |
| parent | 49a8ba06848fa8f282fe9055b4178350970bb0ce (diff) | |
| download | rust-e627f88f88de85cc52ff1c99a076909084806c98.tar.gz rust-e627f88f88de85cc52ff1c99a076909084806c98.zip | |
Implement pinned borrows, part of `pin_ergonomics`
Diffstat (limited to 'compiler/rustc_const_eval/src/check_consts/ops.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/check_consts/ops.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/check_consts/ops.rs b/compiler/rustc_const_eval/src/check_consts/ops.rs index 9c30dbff99e..1bba3fe7ec3 100644 --- a/compiler/rustc_const_eval/src/check_consts/ops.rs +++ b/compiler/rustc_const_eval/src/check_consts/ops.rs @@ -616,11 +616,13 @@ impl<'tcx> NonConstOp<'tcx> for EscapingMutBorrow { kind: ccx.const_kind(), teach: ccx.tcx.sess.teach(E0764), }), - hir::BorrowKind::Ref => ccx.dcx().create_err(errors::MutableRefEscaping { - span, - kind: ccx.const_kind(), - teach: ccx.tcx.sess.teach(E0764), - }), + hir::BorrowKind::Ref | hir::BorrowKind::Pin => { + ccx.dcx().create_err(errors::MutableRefEscaping { + span, + kind: ccx.const_kind(), + teach: ccx.tcx.sess.teach(E0764), + }) + } } } } |
