]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.rs
Rollup merge of #106751 - clubby789:const-intrinsic, r=GuillaumeGomez
[rust.git] / tests / ui / suggestions / imm-ref-trait-object-literal-bound-regions.rs
1 // Regression test for #70813 (this used to trigger a debug assertion)
2
3 trait Trait {}
4
5 struct S;
6
7 impl<'a> Trait for &'a mut S {}
8
9 fn foo<X>(_: X)
10 where
11     for<'b> &'b X: Trait,
12 {
13 }
14
15 fn main() {
16     let s = S;
17     foo::<S>(s); //~ ERROR the trait bound `for<'b> &'b S: Trait` is not satisfied
18 }