]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-45801.rs
point at private fields in struct literal
[rust.git] / src / test / ui / issues / issue-45801.rs
1 struct Params;
2
3 pub trait Plugin<E: ?Sized> {
4     type Error;
5 }
6
7 pub trait Pluggable {
8     fn get_ref<P: Plugin<Self>>(&mut self) -> Option<P::Error> {
9         None
10     }
11 }
12
13 struct Foo;
14 impl Plugin<Foo> for Params {
15     type Error = ();
16 }
17
18 impl<T: Copy> Pluggable for T {}
19
20 fn handle(req: &mut i32) {
21     req.get_ref::<Params>();
22     //~^ ERROR the trait bound `Params: Plugin<i32>` is not satisfied
23 }
24
25 fn main() {}