1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! Macros used by the runtime.
13 //! These macros call functions which are only accessible in the `rt` module, so
14 //! they aren't defined anywhere outside of the `rt` module.
18 macro_rules! rterrln {
19 ($fmt:expr $($arg:tt)*) => ( {
20 ::rt::util::dumb_print(format_args!(concat!($fmt, "\n") $($arg)*))
24 // Some basic logging. Enabled by passing `--cfg rtdebug` to the libstd build.
25 macro_rules! rtdebug {
33 macro_rules! rtassert {
35 if ::rt::util::ENFORCE_SANITY {
37 rtabort!(" assertion failed: {}", stringify!($arg));
43 macro_rules! rtabort {
44 ($($arg:tt)*) => (::rt::util::abort(format_args!($($arg)*)))