]> git.proxmox.com Git - rustc.git/blob - src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / where-clauses / where-clause-constraints-are-local-for-inherent-impl.rs
1 fn require_copy<T: Copy>(x: T) {}
2
3 struct Foo<T> { x: T }
4
5 // Ensure constraints are only attached to methods locally
6 impl<T> Foo<T> {
7 fn needs_copy(self) where T: Copy {
8 require_copy(self.x);
9
10 }
11
12 fn fails_copy(self) {
13 require_copy(self.x);
14 //~^ ERROR the trait bound `T: Copy` is not satisfied
15 }
16 }
17
18 fn main() {}