Skip to content

Commit 0fe2ecd

Browse files
committed
updated stderr 2
1 parent c2ba8c3 commit 0fe2ecd

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

tests/ui/modules/super-at-crate-root.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0433]: failed to resolve: there are too many leading `super` keywords
2-
--> $DIR/super-at-top-level.rs:1:5
2+
--> $DIR/super-at-crate-root.rs:6:5
33
|
44
LL | use super::f;
55
| ^^^^^ there are too many leading `super` keywords

tests/ui/recursion/recursion-tail-cps.rs

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,33 @@
44
55
//@ run-pass
66

7-
fn f(x: isize, cont: fn(isize)) {
8-
if x == 0 {
9-
cont(0);
10-
} else {
11-
g(x - 1, |y| cont(y + 1));
12-
}
7+
fn checktrue(rs: bool) -> bool {
8+
assert!(rs);
9+
return true;
10+
}
11+
12+
pub fn main() {
13+
let k = checktrue;
14+
evenk(42, k);
15+
oddk(45, k);
1316
}
1417

15-
fn g(x: isize, cont: fn(isize)) {
16-
if x == 0 {
17-
cont(0);
18+
fn evenk(n: isize, k: fn(bool) -> bool) -> bool {
19+
println!("evenk");
20+
println!("{}", n);
21+
if n == 0 {
22+
return k(true);
1823
} else {
19-
f(x - 1, |y| cont(y + 1));
24+
return oddk(n - 1, k);
2025
}
2126
}
2227

23-
pub fn main() {
24-
f(100000, |_x| {}); // Test deep recursion
25-
g(100000, |_x| {}); // Test deep recursion
28+
fn oddk(n: isize, k: fn(bool) -> bool) -> bool {
29+
println!("oddk");
30+
println!("{}", n);
31+
if n == 0 {
32+
return k(false);
33+
} else {
34+
return evenk(n - 1, k);
35+
}
2636
}

0 commit comments

Comments
 (0)