Skip to content

Commit 4a2de3b

Browse files
committed
---
yaml --- r: 2196 b: refs/heads/master c: 9ab9bd9 h: refs/heads/master v: v3
1 parent a326e0c commit 4a2de3b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 2361b655261ad48d0eefdaf706ecac6af819e9ad
2+
refs/heads/master: 9ab9bd9cc2dc97c2acc26849dd24b8989b76ea32

trunk/src/comp/middle/ty.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,17 +2484,17 @@ fn lookup_item_type(session.session sess,
24842484
if (did._0 == sess.get_targ_crate_num()) {
24852485
// The item is in this crate. The caller should have added it to the
24862486
// type cache already; we simply return it.
2487-
check (cache.contains_key(did));
24882487
ret cache.get(did);
24892488
}
24902489

2491-
if (cache.contains_key(did)) {
2492-
ret cache.get(did);
2490+
alt (cache.find(did)) {
2491+
case (some[ty_param_count_and_ty](?tpt)) { ret tpt; }
2492+
case (none[ty_param_count_and_ty]) {
2493+
auto tyt = creader.get_type(sess, tystore, did);
2494+
cache.insert(did, tyt);
2495+
ret tyt;
2496+
}
24932497
}
2494-
2495-
auto tyt = creader.get_type(sess, tystore, did);
2496-
cache.insert(did, tyt);
2497-
ret tyt;
24982498
}
24992499

25002500

0 commit comments

Comments
 (0)