Cannot borrow from generic Copy
types in a const
context
#120119
Labels
A-const-eval
Area: Constant evaluation (MIR interpretation)
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
I tried this code:
I expected the
Copy
bounds to be sufficient to allow this to compile.Copy
is an imperfect analog for a lack of interior mutability, much like it is an imperfect analog for!Drop
.Instead, this happened:
Ideally, stable code would be able to bound on a lack of interior mutability (like a
NoCell
/Freeze
trait) to allow this sort of generic code to work without needingconst_refs_to_cell
stabilized, as it's a useful property to be able to bound on forunsafe
code.Meta
The text was updated successfully, but these errors were encountered: