Replacer trait must use &mut self to allow a closure to implement it. See #12224 and #13686.