From 9aaf26e7aa4068d7e5643b136fb70ecd689a746d Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Thu, 10 Nov 2016 19:08:21 +0200 Subject: rustc: rework stability to be on-demand for type-directed lookup. --- src/libsyntax/test.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 4de3baf7d14..fca89e265e4 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -307,7 +307,7 @@ fn generate_test_harness(sess: &ParseSess, /// The expanded code calls some unstable functions in the test crate. fn ignored_span(cx: &TestCtxt, sp: Span) -> Span { let info = ExpnInfo { - call_site: DUMMY_SP, + call_site: sp, callee: NameAndSpan { format: MacroAttribute(Symbol::intern("test")), span: None, @@ -460,6 +460,7 @@ mod __test { fn mk_std(cx: &TestCtxt) -> P { let id_test = Ident::from_str("test"); + let sp = ignored_span(cx, DUMMY_SP); let (vi, vis, ident) = if cx.is_test_crate { (ast::ItemKind::Use( P(nospan(ast::ViewPathSimple(id_test, @@ -474,7 +475,7 @@ fn mk_std(cx: &TestCtxt) -> P { node: vi, attrs: vec![], vis: vis, - span: DUMMY_SP + span: sp }) } @@ -598,7 +599,7 @@ fn mk_tests(cx: &TestCtxt) -> P { // FIXME #15962: should be using quote_item, but that stringifies // __test_reexports, causing it to be reinterned, losing the // gensym information. - let sp = DUMMY_SP; + let sp = ignored_span(cx, DUMMY_SP); let ecx = &cx.ext_cx; let struct_type = ecx.ty_path(ecx.path(sp, vec![ecx.ident_of("self"), ecx.ident_of("test"), -- cgit 1.4.1-3-g733a5