about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/new_ret_no_self_overflow.rs
blob: f317674bc1ae45c59caf3858750f1ae2be94317c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#![feature(type_alias_impl_trait)]
#![warn(clippy::new_ret_no_self)]

mod issue10041 {
    struct Bomb;

    impl Bomb {
        // Hidden <Rhs = Self> default generic parameter.
        pub fn new() -> impl PartialOrd {
            0i32
        }
    }

    // TAIT with self-referencing bounds
    type X = impl std::ops::Add<Output = X>;

    struct Bomb2;

    impl Bomb2 {
        #[define_opaque(X)]
        pub fn new() -> X {
            //~^ ERROR: overflow evaluating the requirement
            0i32
        }
    }
}

fn main() {}