Skip to content

Commit b347097

Browse files
authored
Rollup merge of #71182 - JohnTitor:regression-tests, r=Mark-Simulacrum
Add some regression tests Closes #24843 Closes #28575 Closes #54067 Closes #66868 Closes #67893 Closes #68813
2 parents 5280d15 + a6855b9 commit b347097

File tree

7 files changed

+64
-0
lines changed

7 files changed

+64
-0
lines changed

src/test/ui/asm/issue-54067.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// check-pass
2+
// ignore-emscripten no llvm_asm! support
3+
4+
#![feature(llvm_asm)]
5+
6+
pub fn boot(addr: Option<u32>) {
7+
unsafe {
8+
llvm_asm!("mov sp, $0"::"r" (addr));
9+
}
10+
}
11+
12+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// edition:2018
2+
3+
use std::sync::{Arc, Mutex};
4+
5+
pub async fn f(_: ()) {}
6+
7+
pub async fn run() {
8+
let x: Arc<Mutex<()>> = unimplemented!();
9+
f(*x.lock().unwrap()).await;
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// aux-build: issue_67893.rs
2+
// edition:2018
3+
// dont-check-compiler-stderr
4+
// FIXME(#71222): Add above flag because of the difference of stderrs on some env.
5+
6+
extern crate issue_67893;
7+
8+
fn g(_: impl Send) {}
9+
10+
fn main() {
11+
g(issue_67893::run())
12+
//~^ ERROR: `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely
13+
}

src/test/ui/intrinsics/issue-28575.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(intrinsics)]
2+
3+
extern "C" {
4+
pub static FOO: extern "rust-intrinsic" fn();
5+
}
6+
7+
fn main() {
8+
FOO() //~ ERROR: use of extern static is unsafe
9+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0133]: use of extern static is unsafe and requires unsafe function or block
2+
--> $DIR/issue-28575.rs:8:5
3+
|
4+
LL | FOO()
5+
| ^^^ use of extern static
6+
|
7+
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0133`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub static TEST_STR: &'static str = "Hello world";

src/test/ui/static/issue-24843.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// aux-build: issue_24843.rs
2+
// check-pass
3+
4+
extern crate issue_24843;
5+
6+
static _TEST_STR_2: &'static str = &issue_24843::TEST_STR;
7+
8+
fn main() {}

0 commit comments

Comments
 (0)