With the current behavior, const items get replaced with their values, so there’s no danger in:
const FOO = something;
const BAR = f(&mut FOO);
const BAZ = f(&mut FOO);
(BAR and BAZ are equivalent)
Even if it were encased in a const fn. Ofc, things would be different if they were let instead of const, e.g.:
const BAR_BAZ = {
let foo = something;
let bar = f(&mut FOO);
let baz = f(&mut FOO);
(bar, baz)
};
const BAR = BAR_BAZ.0;
const BAZ = BAR_BAZ.1;
(BAR and BAZ are different)
idk what the stuff about referential transparency means.