Skip to content

Commit 5bb6196

Browse files
committed
Address review comments, add tests
1 parent 1c49eaa commit 5bb6196

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

src/librustc/front/test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,7 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> Gc<ast::Expr> {
545545
let mut visible_path = match cx.toplevel_reexport {
546546
Some(id) => vec![id],
547547
None => {
548-
cx.sess.span_bug(
549-
DUMMY_SP,
548+
cx.sess.bug(
550549
"expected to find top-level re-export name, but found None"
551550
);
552551
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags:--test
12+
13+
// This verifies that the test generation doesn't crash when we have
14+
// no tests - for more information, see PR #16892.

src/test/run-pass/issue-16597.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags:--test
12+
13+
#![feature(globs)]
14+
15+
mod test {
16+
use super::*;
17+
18+
#[test]
19+
fn test(){}
20+
}

0 commit comments

Comments
 (0)