mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-07 12:33:14 +00:00
Move some tests to more reasonable directories
This commit is contained in:
parent
d32993afe8
commit
7fd15f0900
@ -1,25 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
struct X {
|
||||
x: isize
|
||||
}
|
||||
|
||||
fn f1(a: &mut X, b: &mut isize, c: isize) -> isize {
|
||||
let r = a.x + *b + c;
|
||||
a.x = 0;
|
||||
*b = 10;
|
||||
return r;
|
||||
}
|
||||
|
||||
fn f2<F>(a: isize, f: F) -> isize where F: FnOnce(isize) { f(1); return a; }
|
||||
|
||||
pub fn main() {
|
||||
let mut a = X {x: 1};
|
||||
let mut b = 2;
|
||||
let c = 3;
|
||||
assert_eq!(f1(&mut a, &mut b, c), 6);
|
||||
assert_eq!(a.x, 0);
|
||||
assert_eq!(b, 10);
|
||||
assert_eq!(f2(a.x, |_| a.x = 50), 0);
|
||||
assert_eq!(a.x, 50);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
error[E0658]: function pointers cannot appear in constant functions
|
||||
--> $DIR/issue-37550.rs:3:9
|
||||
--> $DIR/issue-37550-1.rs:3:9
|
||||
|
|
||||
LL | let x = || t;
|
||||
| ^
|
@ -1,17 +0,0 @@
|
||||
// run-fail
|
||||
// error-pattern:explicit panic
|
||||
// ignore-emscripten no processes
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
enum Err<T> {
|
||||
Errr(Arc<T>),
|
||||
}
|
||||
|
||||
fn foo() -> Err<isize> {
|
||||
panic!();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _f = foo();
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
fn thing<'r>(x: &'r [isize]) -> &'r [isize] { x }
|
||||
|
||||
pub fn main() {
|
||||
let x = &[1,2,3];
|
||||
let y = x;
|
||||
let z = thing(x);
|
||||
assert_eq!(z[2], x[2]);
|
||||
assert_eq!(z[1], y[1]);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
// run-pass
|
||||
pub fn main() {
|
||||
let mut x = 0;
|
||||
for _ in 0..4096 { x += 1; }
|
||||
assert_eq!(x, 4096);
|
||||
println!("x = {}", x);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
// run-pass
|
||||
pub fn main() {
|
||||
let mut count = 0;
|
||||
for _ in 0..999_999 { count += 1; }
|
||||
assert_eq!(count, 999_999);
|
||||
println!("{}", count);
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
// compile-flags: --crate-type dylib --target thumbv7em-none-eabihf
|
||||
// needs-llvm-components: arm
|
||||
// build-pass
|
||||
// error-pattern: dropping unsupported crate type `dylib` for target `thumbv7em-none-eabihf`
|
||||
|
||||
#![feature(no_core)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
@ -1,4 +0,0 @@
|
||||
warning: dropping unsupported crate type `dylib` for target `thumbv7em-none-eabihf`
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
@ -1,26 +0,0 @@
|
||||
// run-fail
|
||||
// error-pattern:quux
|
||||
// ignore-emscripten no processes
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
fn test00_start(ch: Chan<isize>, message: isize) {
|
||||
send(ch, message);
|
||||
}
|
||||
|
||||
type TaskId = isize;
|
||||
type PortId = isize;
|
||||
|
||||
struct Chan<T> {
|
||||
task: TaskId,
|
||||
port: PortId,
|
||||
marker: PhantomData<*mut T>,
|
||||
}
|
||||
|
||||
fn send<T: Send>(_ch: Chan<T>, _data: T) {
|
||||
panic!();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
panic!("quux");
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user