Skip to content

Commit 82b6dc2

Browse files
committed
fixup tests for new def'n of InlinedItem
it now carries a def-id; supply a dummy
1 parent 8fdc72f commit 82b6dc2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/librustc_metadata/astencode.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,9 @@ fn test_more() {
13831383

13841384
#[test]
13851385
fn test_simplification() {
1386+
use middle::cstore::LOCAL_CRATE;
1387+
use rustc::hir::def_id::CRATE_DEF_INDEX;
1388+
13861389
let cx = mk_ctxt();
13871390
let item = quote_item!(&cx,
13881391
fn new_int_alist<B>() -> alist<isize, B> {
@@ -1393,15 +1396,16 @@ fn test_simplification() {
13931396
let cx = mk_ctxt();
13941397
with_testing_context(|lcx| {
13951398
let hir_item = lcx.lower_item(&item);
1396-
let item_in = InlinedItemRef::Item(&hir_item);
1399+
let def_id = DefId { krate: LOCAL_CRATE, index: CRATE_DEF_INDEX }; // dummy
1400+
let item_in = InlinedItemRef::Item(def_id, &hir_item);
13971401
let (item_out, _) = simplify_ast(item_in);
1398-
let item_exp = InlinedItem::Item(P(lcx.lower_item(&quote_item!(&cx,
1402+
let item_exp = InlinedItem::Item(def_id, P(lcx.lower_item(&quote_item!(&cx,
13991403
fn new_int_alist<B>() -> alist<isize, B> {
14001404
return alist {eq_fn: eq_int, data: Vec::new()};
14011405
}
14021406
).unwrap())));
14031407
match (item_out, item_exp) {
1404-
(InlinedItem::Item(item_out), InlinedItem::Item(item_exp)) => {
1408+
(InlinedItem::Item(_, item_out), InlinedItem::Item(_, item_exp)) => {
14051409
assert!(pprust::item_to_string(&item_out) ==
14061410
pprust::item_to_string(&item_exp));
14071411
}

0 commit comments

Comments
 (0)