Skip to content

Commit 97f5545

Browse files
committed
Add parallel rustc ui tests
1 parent 0984bec commit 97f5545

File tree

9 files changed

+134
-1
lines changed

9 files changed

+134
-1
lines changed

src/tools/tidy/src/ui_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::path::{Path, PathBuf};
1414
// #73494.
1515
const ENTRY_LIMIT: usize = 900;
1616
const ISSUES_ENTRY_LIMIT: usize = 1807;
17-
const ROOT_ENTRY_LIMIT: usize = 870;
17+
const ROOT_ENTRY_LIMIT: usize = 871;
1818

1919
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2020
"rs", // test source files
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// compile-flags: -Z threads=8
2+
// run-pass
3+
4+
fn main() {
5+
println!("Hello world!");
6+
}
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// compile-flags: -Z threads=16
2+
// run-pass
3+
4+
#[repr(transparent)]
5+
struct Sched {
6+
i: i32,
7+
}
8+
impl Sched {
9+
extern "C" fn get(self) -> i32 { self.i }
10+
}
11+
12+
fn main() {
13+
let s = Sched { i: 4 };
14+
let f = || -> i32 {
15+
s.get()
16+
};
17+
println!("f: {}", f());
18+
}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// compile-flags: -Z threads=16
2+
// build-fail
3+
4+
#![crate_type="rlib"]
5+
#![allow(warnings)]
6+
7+
#[export_name="fail"]
8+
pub fn a() {
9+
}
10+
11+
#[export_name="fail"]
12+
pub fn b() {
13+
//~^ Error symbol `fail` is already defined
14+
}
15+
16+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: symbol `fail` is already defined
2+
--> $DIR/issue-111528.rs:12:1
3+
|
4+
LL | pub fn b() {
5+
| ^^^^^^^^^^
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// compile-flags:-C extra-filename=-1 -Z threads=16
2+
// no-prefer-dynamic
3+
// build-pass
4+
#![crate_name = "crateresolve1"]
5+
#![crate_type = "lib"]
6+
7+
pub fn f() -> isize { 10 }
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// compile-flags: -Z threads=16
2+
// build-pass
3+
4+
pub static GLOBAL: isize = 3;
5+
6+
static GLOBAL0: isize = 4;
7+
8+
pub static GLOBAL2: &'static isize = &GLOBAL0;
9+
10+
pub fn verify_same(a: &'static isize) {
11+
let a = a as *const isize as usize;
12+
let b = &GLOBAL as *const isize as usize;
13+
assert_eq!(a, b);
14+
}
15+
16+
pub fn verify_same2(a: &'static isize) {
17+
let a = a as *const isize as usize;
18+
let b = GLOBAL2 as *const isize as usize;
19+
assert_eq!(a, b);
20+
}
21+
22+
fn main() {}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// compile-flags: -Z threads=16
2+
3+
use std::collections::BTreeSet;
4+
5+
#[derive(Hash)]
6+
pub enum ElemDerived {
7+
//~^ ERROR E0072
8+
//~| ERROR E0391
9+
A(ElemDerived)
10+
}
11+
12+
pub enum Elem {
13+
Derived(ElemDerived)
14+
}
15+
16+
pub struct Set(BTreeSet<Elem>);
17+
18+
impl Set {
19+
pub fn into_iter(self) -> impl Iterator<Item = Elem> {
20+
self.0.into_iter()
21+
}
22+
}
23+
24+
fn main() {}
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
error[E0072]: recursive type `ElemDerived` has infinite size
2+
--> $DIR/issue-94654.rs:6:1
3+
|
4+
LL | pub enum ElemDerived {
5+
| ^^^^^^^^^^^^^^^^^^^^
6+
...
7+
LL | A(ElemDerived)
8+
| ----------- recursive without indirection
9+
|
10+
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
11+
|
12+
LL | A(Box<ElemDerived>)
13+
| ++++ +
14+
15+
error[E0391]: cycle detected when computing drop-check constraints for `ElemDerived`
16+
--> $DIR/issue-94654.rs:6:1
17+
|
18+
LL | pub enum ElemDerived {
19+
| ^^^^^^^^^^^^^^^^^^^^
20+
|
21+
= note: ...which immediately requires computing drop-check constraints for `ElemDerived` again
22+
note: cycle used when computing drop-check constraints for `Elem`
23+
--> $DIR/issue-94654.rs:12:1
24+
|
25+
LL | pub enum Elem {
26+
| ^^^^^^^^^^^^^
27+
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
28+
29+
error: aborting due to 2 previous errors
30+
31+
Some errors have detailed explanations: E0072, E0391.
32+
For more information about an error, try `rustc --explain E0072`.

0 commit comments

Comments
 (0)