-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
7 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// check-pass | ||
// ignore-emscripten no llvm_asm! support | ||
|
||
#![feature(llvm_asm)] | ||
|
||
pub fn boot(addr: Option<u32>) { | ||
unsafe { | ||
llvm_asm!("mov sp, $0"::"r" (addr)); | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// edition:2018 | ||
|
||
use std::sync::{Arc, Mutex}; | ||
|
||
pub async fn f(_: ()) {} | ||
|
||
pub async fn run() { | ||
let x: Arc<Mutex<()>> = unimplemented!(); | ||
f(*x.lock().unwrap()).await; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// aux-build: issue_67893.rs | ||
// edition:2018 | ||
// dont-check-compiler-stderr | ||
// FIXME(#71222): Add above flag because of the difference of stderrs on some env. | ||
|
||
extern crate issue_67893; | ||
|
||
fn g(_: impl Send) {} | ||
|
||
fn main() { | ||
g(issue_67893::run()) | ||
//~^ ERROR: `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#![feature(intrinsics)] | ||
|
||
extern "C" { | ||
pub static FOO: extern "rust-intrinsic" fn(); | ||
} | ||
|
||
fn main() { | ||
FOO() //~ ERROR: use of extern static is unsafe | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0133]: use of extern static is unsafe and requires unsafe function or block | ||
--> $DIR/issue-28575.rs:8:5 | ||
| | ||
LL | FOO() | ||
| ^^^ use of extern static | ||
| | ||
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0133`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub static TEST_STR: &'static str = "Hello world"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// aux-build: issue_24843.rs | ||
// check-pass | ||
|
||
extern crate issue_24843; | ||
|
||
static _TEST_STR_2: &'static str = &issue_24843::TEST_STR; | ||
|
||
fn main() {} |