From 215f62c2daa2d14f89d5a526b310976a4ebcf140 Mon Sep 17 00:00:00 2001 From: Cadence Marseille Date: Sat, 16 May 2015 14:36:29 -0400 Subject: [PATCH] fail! -> panic! See rust-lang/rust#17489 --- src/pcre/detail/mod.rs | 12 ++++++------ src/pcre/mod.rs | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pcre/detail/mod.rs b/src/pcre/detail/mod.rs index 17ad9f9..8c4a319 100644 --- a/src/pcre/detail/mod.rs +++ b/src/pcre/detail/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The rust-pcre authors. +// Copyright 2015 The rust-pcre authors. // // Licensed under the Apache License, Version 2.0 or the MIT license @@ -72,7 +72,7 @@ pub unsafe fn pcre_exec(code: *const pcre, extra: *const ::PcreExtra, subject: * if rc == PCRE_ERROR_NOMATCH { return -1; } else if rc < 0 && rc != PCRE_ERROR_NULL { - fail!("pcre_exec"); + panic!("pcre_exec"); } rc @@ -90,7 +90,7 @@ pub unsafe fn pcre_fullinfo(code: *const pcre, extra: *const ::PcreExtra, what: assert!(code.is_not_null()); let rc = native::pcre_fullinfo(code, extra, what, where_); if rc < 0 && rc != PCRE_ERROR_NULL { - fail!("pcre_fullinfo"); + panic!("pcre_fullinfo"); } } @@ -98,9 +98,9 @@ pub unsafe fn pcre_refcount(code: *mut ::detail::pcre, adjust: c_int) -> c_int { assert!(code.is_not_null()); let curr_refcount = native::pcre_refcount(code, 0); if curr_refcount + adjust < 0 { - fail!("refcount underflow"); + panic!("refcount underflow"); } else if curr_refcount + adjust > 65535 { - fail!("refcount overflow"); + panic!("refcount overflow"); } native::pcre_refcount(code, adjust) } @@ -121,7 +121,7 @@ pub unsafe fn pcre_study(code: *const ::detail::pcre, options: &EnumSet<::StudyO None => error!("pcre_study() failed"), Some(err_str) => error!("pcre_study() failed: {}", err_str) } - fail!("pcre_study"); + panic!("pcre_study"); } assert!(err.is_null()); diff --git a/src/pcre/mod.rs b/src/pcre/mod.rs index ae51540..8551e82 100644 --- a/src/pcre/mod.rs +++ b/src/pcre/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The rust-pcre authors. +// Copyright 2015 The rust-pcre authors. // // Licensed under the Apache License, Version 2.0 or the MIT license @@ -192,7 +192,7 @@ impl CLike for CompileOption { 19u => BsrUnicode, 20u => JavaScriptCompat, 21u => Ucp, - _ => fail!("unknown CompileOption number {:u}", n) + _ => panic!("unknown CompileOption number {}", n) } } @@ -241,7 +241,7 @@ impl CLike for ExecOption { 13u => ExecNoStartOptimise, 14u => ExecPartialHard, 15u => ExecNotEmptyAtStart, - _ => fail!("unknown ExecOption number {:u}", n) + _ => panic!("unknown ExecOption number {}", n) } } @@ -276,7 +276,7 @@ impl CLike for ExtraOption { 5u => ExtraMatchLimitRecursion, 6u => ExtraMark, 7u => ExtraExecutableJit, - _ => fail!("unknown ExtraOption number {:u}", n) + _ => panic!("unknown ExtraOption number {}", n) } } @@ -300,7 +300,7 @@ impl CLike for StudyOption { 2u => StudyJitPartialSoftCompile, 3u => StudyJitPartialHardCompile, 4u => StudyExtraNeeded, - _ => fail!("unknown StudyOption number {:u}", n) + _ => panic!("unknown StudyOption number {}", n) } }