Rollup merge of #90947 - c410-f3r:testsssssss, r=petrochenkov
Move some tests to more reasonable directories - 9.5 cc #73494 r? `@petrochenkov`
This commit is contained in:
commit
022709f479
132 changed files with 2 additions and 188 deletions
|
@ -1,10 +0,0 @@
|
||||||
mod foo {
|
|
||||||
pub fn x(y: isize) { log(debug, y); }
|
|
||||||
//~^ ERROR cannot find function `log` in this scope
|
|
||||||
//~| ERROR cannot find value `debug` in this scope
|
|
||||||
fn z(y: isize) { log(debug, y); }
|
|
||||||
//~^ ERROR cannot find function `log` in this scope
|
|
||||||
//~| ERROR cannot find value `debug` in this scope
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() { foo::z(10); } //~ ERROR function `z` is private
|
|
|
@ -1,40 +0,0 @@
|
||||||
error[E0425]: cannot find function `log` in this scope
|
|
||||||
--> $DIR/export.rs:2:26
|
|
||||||
|
|
|
||||||
LL | pub fn x(y: isize) { log(debug, y); }
|
|
||||||
| ^^^ not found in this scope
|
|
||||||
|
|
||||||
error[E0425]: cannot find value `debug` in this scope
|
|
||||||
--> $DIR/export.rs:2:30
|
|
||||||
|
|
|
||||||
LL | pub fn x(y: isize) { log(debug, y); }
|
|
||||||
| ^^^^^ not found in this scope
|
|
||||||
|
|
||||||
error[E0425]: cannot find function `log` in this scope
|
|
||||||
--> $DIR/export.rs:5:22
|
|
||||||
|
|
|
||||||
LL | fn z(y: isize) { log(debug, y); }
|
|
||||||
| ^^^ not found in this scope
|
|
||||||
|
|
||||||
error[E0425]: cannot find value `debug` in this scope
|
|
||||||
--> $DIR/export.rs:5:26
|
|
||||||
|
|
|
||||||
LL | fn z(y: isize) { log(debug, y); }
|
|
||||||
| ^^^^^ not found in this scope
|
|
||||||
|
|
||||||
error[E0603]: function `z` is private
|
|
||||||
--> $DIR/export.rs:10:18
|
|
||||||
|
|
|
||||||
LL | fn main() { foo::z(10); }
|
|
||||||
| ^ private function
|
|
||||||
|
|
|
||||||
note: the function `z` is defined here
|
|
||||||
--> $DIR/export.rs:5:5
|
|
||||||
|
|
|
||||||
LL | fn z(y: isize) { log(debug, y); }
|
|
||||||
| ^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 5 previous errors
|
|
||||||
|
|
||||||
Some errors have detailed explanations: E0425, E0603.
|
|
||||||
For more information about an error, try `rustc --explain E0425`.
|
|
|
@ -1,13 +0,0 @@
|
||||||
// run-pass
|
|
||||||
// Regression test for issue #377
|
|
||||||
|
|
||||||
|
|
||||||
struct A { a: isize }
|
|
||||||
struct V { v: isize }
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
let a = { let b = A {a: 3}; b };
|
|
||||||
assert_eq!(a.a, 3);
|
|
||||||
let c = { let d = V {v: 3}; d };
|
|
||||||
assert_eq!(c.v, 3);
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
// run-pass
|
|
||||||
// pretty-expanded FIXME #23616
|
|
||||||
|
|
||||||
fn leaky<T>(_t: T) { }
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
let x = Box::new(10);
|
|
||||||
leaky::<Box<isize>>(x);
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
// run-pass
|
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
|
||||||
struct Foo(usize);
|
|
||||||
|
|
||||||
fn foo() -> Foo {
|
|
||||||
Foo(42)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
assert_eq!(foo(), Foo(42));
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
// run-pass
|
|
||||||
|
|
||||||
struct X {
|
|
||||||
repr: isize
|
|
||||||
}
|
|
||||||
|
|
||||||
fn apply<T, F>(x: T, f: F) where F: FnOnce(T) {
|
|
||||||
f(x);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn check_int(x: isize) {
|
|
||||||
assert_eq!(x, 22);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn check_struct(x: X) {
|
|
||||||
check_int(x.repr);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
apply(22, check_int);
|
|
||||||
apply(X {repr: 22}, check_struct);
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
// run-pass
|
|
||||||
|
|
||||||
#![allow(dead_code)]
|
|
||||||
// Check that functions can modify local state.
|
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
|
||||||
|
|
||||||
fn sums_to(v: Vec<isize> , sum: isize) -> bool {
|
|
||||||
let mut i = 0;
|
|
||||||
let mut sum0 = 0;
|
|
||||||
while i < v.len() {
|
|
||||||
sum0 += v[i];
|
|
||||||
i += 1;
|
|
||||||
}
|
|
||||||
return sum0 == sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn sums_to_using_uniq(v: Vec<isize> , sum: isize) -> bool {
|
|
||||||
let mut i = 0;
|
|
||||||
let mut sum0: Box<_> = 0.into();
|
|
||||||
while i < v.len() {
|
|
||||||
*sum0 += v[i];
|
|
||||||
i += 1;
|
|
||||||
}
|
|
||||||
return *sum0 == sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn sums_to_using_rec(v: Vec<isize> , sum: isize) -> bool {
|
|
||||||
let mut i = 0;
|
|
||||||
let mut sum0 = F {f: 0};
|
|
||||||
while i < v.len() {
|
|
||||||
sum0.f += v[i];
|
|
||||||
i += 1;
|
|
||||||
}
|
|
||||||
return sum0.f == sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct F<T> { f: T }
|
|
||||||
|
|
||||||
fn sums_to_using_uniq_rec(v: Vec<isize> , sum: isize) -> bool {
|
|
||||||
let mut i = 0;
|
|
||||||
let mut sum0 = F::<Box<_>> {f: 0.into() };
|
|
||||||
while i < v.len() {
|
|
||||||
*sum0.f += v[i];
|
|
||||||
i += 1;
|
|
||||||
}
|
|
||||||
return *sum0.f == sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue