diff options
| author | bors <bors@rust-lang.org> | 2015-01-10 00:55:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-10 00:55:12 +0000 |
| commit | 14f9d1f256e643e65f42737c7d3174bcc7a75abb (patch) | |
| tree | 0e15bb7e97de43a8dd01d80661d4449731a15651 /src/libsyntax | |
| parent | c133b2110b79d7a735032e4af431ee3a1143f3ce (diff) | |
| parent | 9cc847d8c3cb156a2765a6be962209acd472b8aa (diff) | |
| download | rust-14f9d1f256e643e65f42737c7d3174bcc7a75abb.tar.gz rust-14f9d1f256e643e65f42737c7d3174bcc7a75abb.zip | |
auto merge of #20828 : alexcrichton/rust/issue-20823, r=brson
This will temporarily prevent warnings generated from expanding to code that the test harness itself uses. This solution will require tweaking around the beta cycle, but it will prevent spurious warnings for now. Closes #20823
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/test.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index bacfa0bbfce..895268f96c8 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -439,13 +439,19 @@ fn mk_test_module(cx: &mut TestCtxt) -> (P<ast::Item>, Option<ast::ViewItem>) { let item_ = ast::ItemMod(testmod); let mod_ident = token::gensym_ident("__test"); + let allow_unstable = { + let unstable = P(nospan(ast::MetaWord(InternedString::new("unstable")))); + let allow = P(nospan(ast::MetaList(InternedString::new("allow"), + vec![unstable]))); + attr::mk_attr_inner(attr::mk_attr_id(), allow) + }; let item = ast::Item { ident: mod_ident, - attrs: Vec::new(), id: ast::DUMMY_NODE_ID, node: item_, vis: ast::Public, span: DUMMY_SP, + attrs: vec![allow_unstable], }; let reexport = cx.reexport_test_harness_main.as_ref().map(|s| { // building `use <ident> = __test::main` |
