Yes; we were missing a check to make sure the attribute wasn’t just being ignored. See https://github.com/rust-lang/rust/pull/28650 . If this is causing too many regressions, we could probably make it a soft error.
let py = re_phonetic_symbol.replace_all(&p, |caps: &Captures| {
let cap = caps.at(0).unwrap();
let symbol = match PHONETIC_SYMBOL_MAP.get(&cap) {
Some(&v) => v,
None => "",
};
The error is:
src/lib.rs:157:24: 157:29 error: cannot infer an appropriate lifetime for lifetime parameter `'t` due to conflicting req
uirements [E0495]
src/lib.rs:157 let cap = caps.at(0).unwrap();
^~~~~
Captures is: impl<'t> Captures<'t>
And the method has signature: fn at(&self, i: usize) -> Option<&'t str>
Something must have changed in how the explicit type caps: &Captures in the closure is treated?
I’ve submitted a PR to fix the crate by a very simple change, cap instead of &cap(PR). So, why does this work?
I documented the pinyin regression at https://github.com/rust-lang/rust/issues/28854 - this is an unfortunate interaction of “bridge” impls causing a deref coercion to be skipped and the lack of subtyping in trait matching - the code used to work because of a soundness hole.