]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/issue-37945.rs
Suggest defining type parameter when appropriate
[rust.git] / src / test / codegen / issue-37945.rs
1 // compile-flags: -O
2 // ignore-x86
3 // ignore-arm
4 // ignore-emscripten
5 // ignore-gnux32
6 // ignore 32-bit platforms (LLVM has a bug with them)
7
8 // See issue #37945.
9
10 #![crate_type = "lib"]
11
12 use std::slice::Iter;
13
14 // CHECK-LABEL: @is_empty_1
15 #[no_mangle]
16 pub fn is_empty_1(xs: Iter<f32>) -> bool {
17 // CHECK-NOT: icmp eq float* {{.*}}, null
18     {xs}.next().is_none()
19 }
20
21 // CHECK-LABEL: @is_empty_2
22 #[no_mangle]
23 pub fn is_empty_2(xs: Iter<f32>) -> bool {
24 // CHECK-NOT: icmp eq float* {{.*}}, null
25     xs.map(|&x| x).next().is_none()
26 }