break apart tests

This commit is contained in:
Niko Matsakis 2019-01-25 14:53:59 -05:00 committed by Rémy Rakic
parent f5a74d40d9
commit c5dea5753f
3 changed files with 24 additions and 17 deletions

View 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() {}

View file

@ -4,22 +4,6 @@
// = 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
}
// extracted from a similar issue: #57642
trait X {
type G;
@ -38,4 +22,4 @@ fn g() {
let x = <fn (&())>::make_g(); //~ ERROR not general enough
}
fn main() {}
fn main() {}