summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/equality-in-canonical-query.rs
blob: 672b1eeeab69fd5c009b46ff3852b32e1aa4d52e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// issue: #116877
// revisions: sized clone
//[sized] check-pass

//[clone] known-bug: #108498
//[clone] failure-status: 101
//[clone] normalize-stderr-test: "DefId\(.*?\]::" -> "DefId("
//[clone] normalize-stderr-test: "(?m)note: .*$" -> ""
//[clone] normalize-stderr-test: "(?m)^ *\d+: .*\n" -> ""
//[clone] normalize-stderr-test: "(?m)^ *at .*\n" -> ""

#[cfg(sized)] fn rpit() -> impl Sized {}
#[cfg(clone)] fn rpit() -> impl Clone {}

fn same_output<Out>(_: impl Fn() -> Out, _: impl Fn() -> Out) {}

pub fn foo() -> impl Sized {
    same_output(rpit, foo);
    same_output(foo, rpit);
    rpit()
}

fn main () {}