]> git.proxmox.com Git - rustc.git/blob - src/test/ui/span/issue-42234-unknown-receiver-type.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / span / issue-42234-unknown-receiver-type.rs
1 // When the type of a method call's receiver is unknown, the span should point
2 // to the receiver (and not the entire call, as was previously the case before
3 // the fix of which this tests).
4
5 fn shines_a_beacon_through_the_darkness() {
6 let x: Option<_> = None;
7 x.unwrap().method_that_could_exist_on_some_type();
8 //~^ ERROR type annotations needed
9 }
10
11 fn courier_to_des_moines_and_points_west(data: &[u32]) -> String {
12 data.iter()
13 .sum::<_>() //~ ERROR type annotations needed
14 .to_string()
15 }
16
17 fn main() {}