Backed out changeset 8c9117de1e7f (bug 1300152)

This commit is contained in:
Sebastian Hengst
2016-09-09 16:53:45 +02:00
parent 5306356c12
commit 4d0f4ca143
6 changed files with 0 additions and 49 deletions

View File

@@ -1,12 +0,0 @@
function run_test()
{
// Try crashing with a Rust panic
do_crash(function() {
Components.classes["@mozilla.org/xpcom/debug;1"].getService(Components.interfaces.nsIDebug2).rustPanic("OH NO");
},
function(mdump, extra) {
//TODO: check some extra things?
},
// process will exit with a zero exit status
true);
}

View File

@@ -9,8 +9,6 @@ support-files =
[test_crash_moz_crash.js]
[test_crash_purevirtual.js]
[test_crash_runtimeabort.js]
[test_crash_rust_panic.js]
skip-if = !rust
[test_crash_after_js_oom_reported.js]
[test_crash_after_js_oom_recovered.js]
[test_crash_after_js_oom_reported_2.js]

View File

@@ -3,12 +3,3 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
extern crate mp4parse_capi;
use std::ffi::CStr;
use std::os::raw::c_char;
/// Used to implement `nsIDebug2::RustPanic` for testing purposes.
#[no_mangle]
pub extern fn intentional_panic(message: *const c_char) {
panic!("{}", unsafe { CStr::from_ptr(message) }.to_string_lossy());
}

View File

@@ -157,6 +157,3 @@ LOCAL_INCLUDES += [
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
CXXFLAGS += CONFIG['TK_CFLAGS']
if CONFIG['MOZ_RUST']:
DEFINES['MOZ_RUST'] = True

View File

@@ -147,22 +147,6 @@ nsDebugImpl::Abort(const char* aFile, int32_t aLine)
return NS_OK;
}
#ifdef MOZ_RUST
// From toolkit/library/rust/lib.rs
extern "C" void intentional_panic(const char* message);
#endif
NS_IMETHODIMP
nsDebugImpl::RustPanic(const char* aMessage)
{
#ifdef MOZ_RUST
intentional_panic(aMessage);
return NS_OK;
#else
return NS_ERROR_NOT_IMPLEMENTED;
#endif
}
NS_IMETHODIMP
nsDebugImpl::GetIsDebugBuild(bool* aResult)
{

View File

@@ -79,11 +79,4 @@ interface nsIDebug2 : nsISupports
*/
void abort(in string aFile,
in long aLine);
/**
* Request the process to trigger a fatal panic!() from Rust code.
*
* @param aMessage the string to pass to panic!().
*/
void rustPanic(in string aMessage);
};