about summary refs log tree commit diff
path: root/tests/ui/traits/suggest-remove-deref-issue-140166.rs
blob: 1b832c7eba5c059817e8f520a525c2e8824fccb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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() {}