summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.rs
blob: 319789c4ec28296534a6025cc64d9938f2ada5af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Regression test for #70813 (this used to trigger a debug assertion)

trait Trait {}

struct S;

impl<'a> Trait for &'a mut S {}

fn foo<X>(_: X)
where
    for<'b> &'b X: Trait,
{
}

fn main() {
    let s = S;
    foo::<S>(s); //~ ERROR the trait bound `for<'b> &'b S: Trait` is not satisfied
}