//@ build-fail fn assert_zst() { struct F(T); impl F { const V: () = assert!(std::mem::size_of::() == 0); //~^ NOTE: evaluation of `assert_zst::F::::V` failed //~| NOTE: in this expansion of assert! //~| ERROR: assertion failed //~| NOTE: evaluation of `assert_zst::F::::V` failed //~| NOTE: in this expansion of assert! //~| ERROR: assertion failed } F::::V; //~^NOTE: erroneous constant //~|NOTE: erroneous constant //~|NOTE: duplicate } fn foo() { assert_zst::() //~^ NOTE: the above error was encountered while instantiating `fn assert_zst::` //~| NOTE: the above error was encountered while instantiating `fn assert_zst::` } fn bar() { foo::() } fn main() { bar::<()>(); bar::(); bar::(); bar::(); }