]>
git.proxmox.com Git - rustc.git/blob - src/libstd/rt/macros.rs
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.
16 macro_rules
! rterrln
{
18 ::rt
::util
::dumb_print(format_args
!(concat
!($fmt
, "\n")))
20 ($fmt
:expr
, $
($arg
:expr
),*) => ( {
21 ::rt
::util
::dumb_print(format_args
!(concat
!($fmt
, "\n"), $
($arg
),*))
25 // Some basic logging. Enabled by passing `--cfg rtdebug` to the libstd build.
26 macro_rules
! rtdebug
{
32 ($
str:expr
, $
($arg
:expr
),*) => ( {
34 rterrln
!($
str, $
($arg
),*)
39 macro_rules
! rtassert
{
41 if ::rt
::util
::ENFORCE_SANITY
{
43 rtabort
!(" assertion failed: {}", stringify
!($arg
));
49 macro_rules
! rtabort
{
50 ($
($arg
:tt
)*) => (::rt
::util
::abort(format_args
!($
($arg
)*)))