Rollup merge of #104895 - chenyukang:yukang/fix-104884-serde, r=TaKO8Ki
Avoid Invalid code suggested when encountering unsatisfied trait bounds in derive macro code Fixes #104884
This commit is contained in:
commit
eabc0720a6
4 changed files with 97 additions and 0 deletions
|
@ -355,6 +355,12 @@ pub fn suggest_constraining_type_params<'a>(
|
|||
));
|
||||
}
|
||||
|
||||
// FIXME: remove the suggestions that are from derive, as the span is not correct
|
||||
suggestions = suggestions
|
||||
.into_iter()
|
||||
.filter(|(span, _, _)| !span.in_derive_expansion())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if suggestions.len() == 1 {
|
||||
let (span, suggestion, msg) = suggestions.pop().unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue