]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-69455.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / issues / issue-69455.rs
1 // Regression test for #69455: projection predicate was not satisfied.
2 // Compiler should indicate the correct location of the
3 // unsatisfied projection predicate
4
5 pub trait Test<Rhs = Self> {
6 type Output;
7
8 fn test(self, rhs: Rhs) -> Self::Output;
9 }
10
11 impl Test<u32> for u64 {
12 type Output = u64;
13
14 fn test(self, other: u32) -> u64 {
15 self + (other as u64)
16 }
17 }
18
19 impl Test<u64> for u64 {
20 type Output = u64;
21
22 fn test(self, other: u64) -> u64 {
23 (self + other) as u64
24 }
25 }
26
27 fn main() {
28 let xs: Vec<u64> = vec![1, 2, 3];
29 println!("{}", 23u64.test(xs.iter().sum())); //~ ERROR: type annotations needed
30 }