rust/tests/ui/traits/suggest-remove-deref-issue-140166.rs
xizheyin f46806fb14
Add ui test suggest-remove-deref-issue-140166
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-07 17:32:59 +08:00

19 lines
374 B
Rust

trait Trait {}
struct Chars;
impl Trait for Chars {}
struct FlatMap<T>(T);
impl<T: Trait> std::fmt::Debug for FlatMap<T> {
fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
unimplemented!()
}
}
fn lol() {
format_args!("{:?}", FlatMap(&Chars));
//~^ ERROR the trait bound `&Chars: Trait` is not satisfied [E0277]
}
fn main() {}