1 // error-pattern: `#[panic_handler]` function required, but not found
3 // Regression test for #54505 - range borrowing suggestion had
4 // incorrect syntax (missing parentheses).
6 // This test doesn't use std
7 // (so all Ranges resolve to core::ops::Range...)
10 #![feature(lang_items)]
12 use core::ops::RangeBounds;
14 #[cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))]
15 #[lang = "eh_personality"]
16 extern "C" fn eh_personality() {}
17 #[cfg(target_os = "emscripten")]
18 #[lang = "eh_catch_typeinfo"]
19 static EH_CATCH_TYPEINFO: u8 = 0;
22 // take a reference to any built-in range
23 fn take_range(_r: &impl RangeBounds<i8>) {}
28 //~^ ERROR mismatched types [E0308]
29 //~| HELP consider borrowing here
30 //~| SUGGESTION &(0..1)
33 //~^ ERROR mismatched types [E0308]
34 //~| HELP consider borrowing here
35 //~| SUGGESTION &(1..)
38 //~^ ERROR mismatched types [E0308]
39 //~| HELP consider borrowing here
43 //~^ ERROR mismatched types [E0308]
44 //~| HELP consider borrowing here
45 //~| SUGGESTION &(0..=1)
48 //~^ ERROR mismatched types [E0308]
49 //~| HELP consider borrowing here
50 //~| SUGGESTION &(..5)
53 //~^ ERROR mismatched types [E0308]
54 //~| HELP consider borrowing here
55 //~| SUGGESTION &(..=42)