mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
break apart tests
This commit is contained in:
parent
f5a74d40d9
commit
c5dea5753f
23
src/test/ui/issues/issue-57362-1.rs
Executable file
23
src/test/ui/issues/issue-57362-1.rs
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
// Test for issue #57362, ensuring that the self ty is shown in cases of higher-ranked lifetimes
|
||||||
|
// conflicts: the `expected` and `found` trait refs would otherwise be printed the same, leading
|
||||||
|
// to confusing notes such as:
|
||||||
|
// = note: expected type `Trait`
|
||||||
|
// found type `Trait`
|
||||||
|
|
||||||
|
// from issue #57362
|
||||||
|
trait Trait {
|
||||||
|
fn f(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T> Trait for fn(&T) {
|
||||||
|
fn f(self) {
|
||||||
|
println!("f");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn f() {
|
||||||
|
let a: fn(_) = |_: &u8| {};
|
||||||
|
a.f(); //~ ERROR not general enough
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
18
src/test/ui/issues/issue-57362.rs → src/test/ui/issues/issue-57362-2.rs
Executable file → Normal file
18
src/test/ui/issues/issue-57362.rs → src/test/ui/issues/issue-57362-2.rs
Executable file → Normal file
@ -4,22 +4,6 @@
|
|||||||
// = note: expected type `Trait`
|
// = note: expected type `Trait`
|
||||||
// found type `Trait`
|
// found type `Trait`
|
||||||
|
|
||||||
// from issue #57362
|
|
||||||
trait Trait {
|
|
||||||
fn f(self);
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T> Trait for fn(&T) {
|
|
||||||
fn f(self) {
|
|
||||||
println!("f");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn f() {
|
|
||||||
let a: fn(_) = |_: &u8| {};
|
|
||||||
a.f(); //~ ERROR not general enough
|
|
||||||
}
|
|
||||||
|
|
||||||
// extracted from a similar issue: #57642
|
// extracted from a similar issue: #57642
|
||||||
trait X {
|
trait X {
|
||||||
type G;
|
type G;
|
||||||
@ -38,4 +22,4 @@ fn g() {
|
|||||||
let x = <fn (&())>::make_g(); //~ ERROR not general enough
|
let x = <fn (&())>::make_g(); //~ ERROR not general enough
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
Loading…
Reference in New Issue
Block a user