Skip to content

Commit 9e1b2d9

Browse files
committed
Add new ui tests
1 parent 88d6e9f commit 9e1b2d9

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

src/tools/tidy/src/ui_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::path::{Path, PathBuf};
1515
const ENTRY_LIMIT: usize = 900;
1616
// FIXME: The following limits should be reduced eventually.
1717
const ISSUES_ENTRY_LIMIT: usize = 1819;
18-
const ROOT_ENTRY_LIMIT: usize = 871;
18+
const ROOT_ENTRY_LIMIT: usize = 872;
1919

2020
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2121
"rs", // test source files
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// run-fail
2+
// compile-flags: -Copt-level=3 -Cdebug-assertions=yes
3+
// error-pattern: unsafe precondition(s) violated: slice::from_raw_parts
4+
// ignore-debug
5+
// ignore-wasm32-bare no panic messages
6+
7+
fn main() {
8+
unsafe {
9+
let _s: &[u64] = std::slice::from_raw_parts(1usize as *const u64, 0);
10+
}
11+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// run-fail
2+
// compile-flags: -Copt-level=3 -Cdebug-assertions=yes
3+
// error-pattern: unsafe precondition(s) violated: slice::from_raw_parts
4+
// ignore-debug
5+
// ignore-wasm32-bare no panic messages
6+
7+
fn main() {
8+
unsafe {
9+
let _s: &[u8] = std::slice::from_raw_parts(std::ptr::null(), 0);
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// run-fail
2+
// compile-flags: -Copt-level=3 -Cdebug-assertions=yes
3+
// error-pattern: unsafe precondition(s) violated: hint::assert_unchecked
4+
// ignore-debug
5+
// ignore-wasm32-bare no panic messages
6+
7+
fn main() {
8+
unsafe {
9+
let sli: &[u8] = &[0];
10+
sli.get_unchecked(1);
11+
}
12+
}

0 commit comments

Comments
 (0)