]> git.lizzy.rs Git - rust.git/blob - tests/ui/chalkify/inherent_impl_min.rs
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / ui / chalkify / inherent_impl_min.rs
1 // run-pass
2 // compile-flags: -Z trait-solver=chalk
3
4 trait Foo { }
5
6 impl Foo for i32 { }
7
8 struct S<T: Foo> {
9     x: T,
10 }
11
12 fn only_foo<T: Foo>(_x: &T) { }
13
14 impl<T> S<T> {
15     // Test that we have the correct environment inside an inherent method.
16     fn dummy_foo(&self) {
17         only_foo(&self.x)
18     }
19 }
20
21 fn main() {
22     let s = S {
23         x: 5,
24     };
25
26     s.dummy_foo();
27 }