Add some tests
This commit is contained in:
parent
b28221e74f
commit
c75f7283bf
38 changed files with 998 additions and 0 deletions
25
tests/ui/impl-trait/call_method_on_inherent_impl.rs
Normal file
25
tests/ui/impl-trait/call_method_on_inherent_impl.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
//@ revisions: current next
|
||||
//@[next] compile-flags: -Znext-solver
|
||||
//@[current] check-pass
|
||||
|
||||
trait MyDebug {
|
||||
fn my_debug(&self);
|
||||
}
|
||||
|
||||
impl<T> MyDebug for T
|
||||
where
|
||||
T: std::fmt::Debug,
|
||||
{
|
||||
fn my_debug(&self) {}
|
||||
}
|
||||
|
||||
fn my_foo() -> impl std::fmt::Debug {
|
||||
if false {
|
||||
let x = my_foo();
|
||||
//[next]~^ type annotations needed
|
||||
x.my_debug();
|
||||
}
|
||||
()
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue