1 // Companion test to the similarly-named file in run-pass.
3 // compile-flags: -C debug_assertions=yes
6 #![feature(lang_items)]
7 #![cfg_attr(core, no_std)]
9 #[cfg(std)] use std::fmt;
10 #[cfg(core)] use core::fmt;
11 #[cfg(core)] #[lang = "eh_personality"] fn eh_personality() {}
12 #[cfg(core)] #[lang = "eh_catch_typeinfo"] static EH_CATCH_TYPEINFO: u8 = 0;
13 #[cfg(core)] #[lang = "panic_impl"] fn panic_impl(panic: &core::panic::PanicInfo) -> ! { loop {} }
15 // (see documentation of the similarly-named test in run-pass)
16 fn to_format_or_not_to_format() {
17 let falsum = || false;
19 // assert!(true, "{}",); // see run-pass
21 assert_eq!(1, 1, "{}",);
22 //[core]~^ ERROR no arguments
23 //[std]~^^ ERROR no arguments
24 assert_ne!(1, 2, "{}",);
25 //[core]~^ ERROR no arguments
26 //[std]~^^ ERROR no arguments
28 // debug_assert!(true, "{}",); // see run-pass
30 debug_assert_eq!(1, 1, "{}",);
31 //[core]~^ ERROR no arguments
32 //[std]~^^ ERROR no arguments
33 debug_assert_ne!(1, 2, "{}",);
34 //[core]~^ ERROR no arguments
35 //[std]~^^ ERROR no arguments
39 //[std]~^ ERROR no arguments
44 //[std]~^ ERROR no arguments
49 //[std]~^ ERROR no arguments
53 //[core]~^ ERROR no arguments
54 //[std]~^^ ERROR no arguments
56 // if falsum() { panic!("{}",); } // see run-pass
60 //[std]~^ ERROR no arguments
65 //[std]~^ ERROR no arguments
68 unimplemented!("{}",);
69 //[core]~^ ERROR no arguments
70 //[std]~^^ ERROR no arguments
72 // if falsum() { unreachable!("{}",); } // see run-pass
75 impl fmt::Display for S {
76 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
78 //[core]~^ ERROR no arguments
79 //[std]~^^ ERROR no arguments
82 //[core]~^ ERROR no arguments
83 //[std]~^^ ERROR no arguments