Skip to content

Commit c5dea57

Browse files
nikomatsakislqd
authored andcommitted
break apart tests
1 parent f5a74d4 commit c5dea57

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

src/test/ui/issues/issue-57362-1.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Test for issue #57362, ensuring that the self ty is shown in cases of higher-ranked lifetimes
2+
// conflicts: the `expected` and `found` trait refs would otherwise be printed the same, leading
3+
// to confusing notes such as:
4+
// = note: expected type `Trait`
5+
// found type `Trait`
6+
7+
// from issue #57362
8+
trait Trait {
9+
fn f(self);
10+
}
11+
12+
impl<T> Trait for fn(&T) {
13+
fn f(self) {
14+
println!("f");
15+
}
16+
}
17+
18+
fn f() {
19+
let a: fn(_) = |_: &u8| {};
20+
a.f(); //~ ERROR not general enough
21+
}
22+
23+
fn main() {}

src/test/ui/issues/issue-57362.rs renamed to src/test/ui/issues/issue-57362-2.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,6 @@
44
// = note: expected type `Trait`
55
// found type `Trait`
66

7-
// from issue #57362
8-
trait Trait {
9-
fn f(self);
10-
}
11-
12-
impl<T> Trait for fn(&T) {
13-
fn f(self) {
14-
println!("f");
15-
}
16-
}
17-
18-
fn f() {
19-
let a: fn(_) = |_: &u8| {};
20-
a.f(); //~ ERROR not general enough
21-
}
22-
237
// extracted from a similar issue: #57642
248
trait X {
259
type G;
@@ -38,4 +22,4 @@ fn g() {
3822
let x = <fn (&())>::make_g(); //~ ERROR not general enough
3923
}
4024

41-
fn main() {}
25+
fn main() {}

0 commit comments

Comments
 (0)