about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/crashes/ice-14935.rs
blob: 74cda9aae53a5594e91d97aa22e824bdc9fb229c (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
//@check-pass
#![warn(clippy::mutable_key_type)]

use std::marker::PhantomData;

trait Group {
    type ExposantSet: Group;
}

struct Pow<T: Group> {
    exposant: Box<Pow<T::ExposantSet>>,
    _p: PhantomData<T>,
}

impl<T: Group> Pow<T> {
    fn is_zero(&self) -> bool {
        false
    }
    fn normalize(&self) {
        #[expect(clippy::if_same_then_else)]
        if self.is_zero() {
        } else if false {
        }
    }
}

fn main() {}