summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/issue-7447.rs
blob: 7e7ef209d485223108952a157f128f6d467fc907 (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
29
30
31
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::marker::PhantomData;
use std::sync::Arc;

fn byte_view<'a>(s: &'a ByteView<'_>) -> BTreeMap<&'a str, ByteView<'a>> {
    panic!()
}

fn group_entries(s: &()) -> BTreeMap<Cow<'_, str>, Vec<Cow<'_, str>>> {
    todo!()
}

struct Mmap;

enum ByteViewBacking<'a> {
    Buf(Cow<'a, [u8]>),
    Mmap(Mmap),
}

pub struct ByteView<'a> {
    backing: Arc<ByteViewBacking<'a>>,
}

fn main() {
    byte_view(panic!());
    //~^ ERROR: sub-expression diverges
    //~| NOTE: `-D clippy::diverging-sub-expression` implied by `-D warnings`
    group_entries(panic!());
    //~^ ERROR: sub-expression diverges
}