[#2242] Make $-variables const during rule execution