2024-04-15 11:20:33 +00:00
|
|
|
//@ revisions: current next
|
|
|
|
//@[next] compile-flags: -Znext-solver
|
|
|
|
|
|
|
|
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();
|
2025-04-05 19:19:56 +03:00
|
|
|
//[next]~^ ERROR type annotations needed
|
2024-04-15 11:20:33 +00:00
|
|
|
x.my_debug();
|
2025-04-05 19:19:56 +03:00
|
|
|
//[current]~^ ERROR no method named `my_debug` found
|
2024-04-15 11:20:33 +00:00
|
|
|
}
|
|
|
|
()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn my_bar() -> impl std::fmt::Debug {
|
|
|
|
if false {
|
|
|
|
let x = &my_bar();
|
2025-04-05 19:19:56 +03:00
|
|
|
//[next]~^ ERROR type annotations needed
|
2024-04-15 11:20:33 +00:00
|
|
|
x.my_debug();
|
|
|
|
}
|
|
|
|
()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|