mirror of
https://github.com/dtolnay/thiserror.git
synced 2025-04-04 13:27:38 +03:00
Check infinite recursion as soon as Display bound is known
This commit is contained in:
parent
8a77dea3ae
commit
f4d5c2a5de
1 changed files with 1 additions and 1 deletions
|
@ -116,6 +116,7 @@ impl Display<'_> {
|
||||||
Trait::Display
|
Trait::Display
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
infinite_recursive |= member == *"self" && bound == Trait::Display;
|
||||||
if let Some(&field) = member_index.get(&member) {
|
if let Some(&field) = member_index.get(&member) {
|
||||||
implied_bounds.insert((field, bound));
|
implied_bounds.insert((field, bound));
|
||||||
}
|
}
|
||||||
|
@ -128,7 +129,6 @@ impl Display<'_> {
|
||||||
}
|
}
|
||||||
out += &formatvar.to_string();
|
out += &formatvar.to_string();
|
||||||
let local = formatvar.to_local();
|
let local = formatvar.to_local();
|
||||||
infinite_recursive |= member == *"self" && bound == Trait::Display;
|
|
||||||
if macro_named_args.insert(member) {
|
if macro_named_args.insert(member) {
|
||||||
bindings.push((local, binding_value));
|
bindings.push((local, binding_value));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue