Closed
Description
The word const
currently means three things:
&const
as a mutability qualifier, supertype of "mut" and "" (immut). Directly analogous to C/C++'s meaning.const x: ty = val;
for constant globals. Same as the meaning in C/C++/Java/etc.T: Const
as a trait, which indicates "no embedded mutability". Corresponds to nothing in any other language, as far as I know.
I propose we change the third one, and leave the other two as they are. Const
doesn't even mean the data is constant (it can be borrowed as mutable). In working on the regions paper, I figured this is always used, conceptually, to indicate a "freezable" data structure -- one which becomes deeply constant only when borrowed from immutably. Let's call it that.