Avoid double hashset lookup.
Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>
This commit is contained in:
parent
6c57de1166
commit
7708abbbef
1 changed files with 1 additions and 2 deletions
|
@ -2161,12 +2161,11 @@ impl ClashingExternDeclarations {
|
||||||
ckind: CItemKind,
|
ckind: CItemKind,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
debug!("structurally_same_type_impl(cx, a = {:?}, b = {:?})", a, b);
|
debug!("structurally_same_type_impl(cx, a = {:?}, b = {:?})", a, b);
|
||||||
if seen_types.contains(&(a, b)) {
|
if !seen_types.insert((a, b)) {
|
||||||
// We've encountered a cycle. There's no point going any further -- the types are
|
// We've encountered a cycle. There's no point going any further -- the types are
|
||||||
// structurally the same.
|
// structurally the same.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
seen_types.insert((a, b));
|
|
||||||
let tcx = cx.tcx;
|
let tcx = cx.tcx;
|
||||||
if a == b || rustc_middle::ty::TyS::same_type(a, b) {
|
if a == b || rustc_middle::ty::TyS::same_type(a, b) {
|
||||||
// All nominally-same types are structurally same, too.
|
// All nominally-same types are structurally same, too.
|
||||||
|
|
Loading…
Reference in a new issue