2022-06-21 08:56:26 -05:00
|
|
|
#![feature(prelude_import)]
|
|
|
|
#![no_std]
|
|
|
|
// check-pass
|
|
|
|
// compile-flags: -Z unpretty=expanded
|
|
|
|
|
2023-05-24 19:15:50 -05:00
|
|
|
#![feature(core_intrinsics, generic_assert)]
|
2022-06-21 08:56:26 -05:00
|
|
|
#[prelude_import]
|
|
|
|
use ::std::prelude::rust_2015::*;
|
|
|
|
#[macro_use]
|
|
|
|
extern crate std;
|
|
|
|
|
|
|
|
fn arbitrary_consuming_method_for_demonstration_purposes() {
|
|
|
|
let elem = 1i32;
|
|
|
|
{
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use ::core::asserting::{TryCaptureGeneric, TryCapturePrintable};
|
|
|
|
let mut __capture0 = ::core::asserting::Capture::new();
|
|
|
|
let __local_bind0 = &elem;
|
|
|
|
if ::core::intrinsics::unlikely(!(*{
|
|
|
|
(&::core::asserting::Wrapper(__local_bind0)).try_capture(&mut __capture0);
|
|
|
|
__local_bind0
|
|
|
|
} as usize)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
2023-01-11 14:41:58 -06:00
|
|
|
::std::rt::panic_fmt(format_args!("Assertion failed: elem as usize\nWith captures:\n elem = {0:?}\n",
|
2022-11-07 15:23:16 -06:00
|
|
|
__capture0));
|
2022-06-21 08:56:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
fn addr_of() {
|
|
|
|
let elem = 1i32;
|
|
|
|
{
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use ::core::asserting::{TryCaptureGeneric, TryCapturePrintable};
|
|
|
|
let mut __capture0 = ::core::asserting::Capture::new();
|
|
|
|
let __local_bind0 = &elem;
|
|
|
|
if ::core::intrinsics::unlikely(!&*__local_bind0) {
|
|
|
|
(&::core::asserting::Wrapper(__local_bind0)).try_capture(&mut __capture0);
|
|
|
|
{
|
2023-01-11 14:41:58 -06:00
|
|
|
::std::rt::panic_fmt(format_args!("Assertion failed: &elem\nWith captures:\n elem = {0:?}\n",
|
2022-11-07 15:23:16 -06:00
|
|
|
__capture0));
|
2022-06-21 08:56:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
fn binary() {
|
|
|
|
let elem = 1i32;
|
|
|
|
{
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use ::core::asserting::{TryCaptureGeneric, TryCapturePrintable};
|
|
|
|
let mut __capture0 = ::core::asserting::Capture::new();
|
|
|
|
let __local_bind0 = &elem;
|
|
|
|
if ::core::intrinsics::unlikely(!(*__local_bind0 == 1)) {
|
|
|
|
(&::core::asserting::Wrapper(__local_bind0)).try_capture(&mut __capture0);
|
|
|
|
{
|
2023-01-11 14:41:58 -06:00
|
|
|
::std::rt::panic_fmt(format_args!("Assertion failed: elem == 1\nWith captures:\n elem = {0:?}\n",
|
2022-11-07 15:23:16 -06:00
|
|
|
__capture0));
|
2022-06-21 08:56:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
{
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use ::core::asserting::{TryCaptureGeneric, TryCapturePrintable};
|
|
|
|
let mut __capture0 = ::core::asserting::Capture::new();
|
|
|
|
let __local_bind0 = &elem;
|
|
|
|
if ::core::intrinsics::unlikely(!(*__local_bind0 >= 1)) {
|
|
|
|
(&::core::asserting::Wrapper(__local_bind0)).try_capture(&mut __capture0);
|
|
|
|
{
|
2023-01-11 14:41:58 -06:00
|
|
|
::std::rt::panic_fmt(format_args!("Assertion failed: elem >= 1\nWith captures:\n elem = {0:?}\n",
|
2022-11-07 15:23:16 -06:00
|
|
|
__capture0));
|
2022-06-21 08:56:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
{
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use ::core::asserting::{TryCaptureGeneric, TryCapturePrintable};
|
|
|
|
let mut __capture0 = ::core::asserting::Capture::new();
|
|
|
|
let __local_bind0 = &elem;
|
|
|
|
if ::core::intrinsics::unlikely(!(*__local_bind0 > 0)) {
|
|
|
|
(&::core::asserting::Wrapper(__local_bind0)).try_capture(&mut __capture0);
|
|
|
|
{
|
2023-01-11 14:41:58 -06:00
|
|
|
::std::rt::panic_fmt(format_args!("Assertion failed: elem > 0\nWith captures:\n elem = {0:?}\n",
|
2022-11-07 15:23:16 -06:00
|
|
|
__capture0));
|
2022-06-21 08:56:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
{
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use ::core::asserting::{TryCaptureGeneric, TryCapturePrintable};
|
|
|
|
let mut __capture0 = ::core::asserting::Capture::new();
|
|
|
|
let __local_bind0 = &elem;
|
|
|
|
if ::core::intrinsics::unlikely(!(*__local_bind0 < 3)) {
|
|
|
|
(&::core::asserting::Wrapper(__local_bind0)).try_capture(&mut __capture0);
|
|
|
|
{
|
2023-01-11 14:41:58 -06:00
|
|
|
::std::rt::panic_fmt(format_args!("Assertion failed: elem < 3\nWith captures:\n elem = {0:?}\n",
|
2022-11-07 15:23:16 -06:00
|
|
|
__capture0));
|
2022-06-21 08:56:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
{
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use ::core::asserting::{TryCaptureGeneric, TryCapturePrintable};
|
|
|
|
let mut __capture0 = ::core::asserting::Capture::new();
|
|
|
|
let __local_bind0 = &elem;
|
|
|
|
if ::core::intrinsics::unlikely(!(*__local_bind0 <= 3)) {
|
|
|
|
(&::core::asserting::Wrapper(__local_bind0)).try_capture(&mut __capture0);
|
|
|
|
{
|
2023-01-11 14:41:58 -06:00
|
|
|
::std::rt::panic_fmt(format_args!("Assertion failed: elem <= 3\nWith captures:\n elem = {0:?}\n",
|
2022-11-07 15:23:16 -06:00
|
|
|
__capture0));
|
2022-06-21 08:56:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
{
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use ::core::asserting::{TryCaptureGeneric, TryCapturePrintable};
|
|
|
|
let mut __capture0 = ::core::asserting::Capture::new();
|
|
|
|
let __local_bind0 = &elem;
|
|
|
|
if ::core::intrinsics::unlikely(!(*__local_bind0 != 3)) {
|
|
|
|
(&::core::asserting::Wrapper(__local_bind0)).try_capture(&mut __capture0);
|
|
|
|
{
|
2023-01-11 14:41:58 -06:00
|
|
|
::std::rt::panic_fmt(format_args!("Assertion failed: elem != 3\nWith captures:\n elem = {0:?}\n",
|
2022-11-07 15:23:16 -06:00
|
|
|
__capture0));
|
2022-06-21 08:56:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
fn unary() {
|
|
|
|
let elem = &1i32;
|
|
|
|
{
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use ::core::asserting::{TryCaptureGeneric, TryCapturePrintable};
|
|
|
|
let mut __capture0 = ::core::asserting::Capture::new();
|
|
|
|
let __local_bind0 = &elem;
|
|
|
|
if ::core::intrinsics::unlikely(!**__local_bind0) {
|
|
|
|
(&::core::asserting::Wrapper(__local_bind0)).try_capture(&mut __capture0);
|
|
|
|
{
|
2023-01-11 14:41:58 -06:00
|
|
|
::std::rt::panic_fmt(format_args!("Assertion failed: *elem\nWith captures:\n elem = {0:?}\n",
|
2022-11-07 15:23:16 -06:00
|
|
|
__capture0));
|
2022-06-21 08:56:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
fn main() {}
|