From 64423f0e34cc4a7d78c15b345b3b8f58243d8286 Mon Sep 17 00:00:00 2001 From: Vivian Lim Date: Sat, 6 Feb 2021 22:11:59 -0800 Subject: Delete ctr-std to use my fork of the rust repo instead --- ctr-std/src/sys_common/util.rs | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 ctr-std/src/sys_common/util.rs (limited to 'ctr-std/src/sys_common/util.rs') diff --git a/ctr-std/src/sys_common/util.rs b/ctr-std/src/sys_common/util.rs deleted file mode 100644 index a373e98..0000000 --- a/ctr-std/src/sys_common/util.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use fmt; -use io::prelude::*; -use sys::stdio::{Stderr, stderr_prints_nothing}; -use thread; - -pub fn dumb_print(args: fmt::Arguments) { - if stderr_prints_nothing() { - return - } - let _ = Stderr::new().map(|mut stderr| stderr.write_fmt(args)); -} - -// Other platforms should use the appropriate platform-specific mechanism for -// aborting the process. If no platform-specific mechanism is available, -// ::intrinsics::abort() may be used instead. The above implementations cover -// all targets currently supported by libstd. - -pub fn abort(args: fmt::Arguments) -> ! { - dumb_print(format_args!("fatal runtime error: {}\n", args)); - unsafe { ::sys::abort_internal(); } -} - -#[allow(dead_code)] // stack overflow detection not enabled on all platforms -pub unsafe fn report_overflow() { - dumb_print(format_args!("\nthread '{}' has overflowed its stack\n", - thread::current().name().unwrap_or(""))); -} -- cgit v1.2.3