diff options
| author | Ralf Jung <post@ralfj.de> | 2024-08-02 15:34:59 +0200 | 
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-09-10 10:26:16 +0200 | 
| commit | f76f128dc9dea86f52a40d465430a7feddca271a (patch) | |
| tree | 8be34eea1342aa01c46609f55d78cb4fe64d2352 /compiler/rustc_const_eval/src/check_consts/check.rs | |
| parent | 304b7f801bab31233680879ca4fb6eb294706a59 (diff) | |
| download | rust-f76f128dc9dea86f52a40d465430a7feddca271a.tar.gz rust-f76f128dc9dea86f52a40d465430a7feddca271a.zip | |
const-eval interning: accpt interior mutable pointers in final value (but keep rejecting mutable references)
Diffstat (limited to 'compiler/rustc_const_eval/src/check_consts/check.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/check_consts/check.rs | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/compiler/rustc_const_eval/src/check_consts/check.rs b/compiler/rustc_const_eval/src/check_consts/check.rs index 8be327a8b56..828d8354c63 100644 --- a/compiler/rustc_const_eval/src/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/check_consts/check.rs @@ -538,8 +538,9 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { // final value. // Note: This is only sound if every local that has a `StorageDead` has a // `StorageDead` in every control flow path leading to a `return` terminator. - // The good news is that interning will detect if any unexpected mutable - // pointer slips through. + // If anything slips through, there's no safety net -- safe code can create + // references to variants of `!Freeze` enums as long as that variant is `Freeze`, + // so interning can't protect us here. if self.local_is_transient(place.local) { self.check_op(ops::TransientCellBorrow); } else { | 
