File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 23
23
///
24
24
/// Returns a value of type `T`. However, this function never actually returns a
25
25
/// value as it always causes a panic.
26
+ #cfg (not (target = "native" ))
26
27
pub fn [T ] abort (msg : String ) -> T {
27
28
let _ = msg
28
29
panic_impl ()
29
30
}
30
31
32
+ ///|
33
+ #cfg (target = "native" )
34
+ fn println (s : String ) -> Unit = "%println"
35
+
36
+ ///|
37
+ /// Aborts the program with an error message. Always causes a panic, regardless
38
+ /// of the message provided.
39
+ ///
40
+ /// Parameters:
41
+ ///
42
+ /// * `message` : A string containing the error message to be displayed when
43
+ /// aborting.
44
+ ///
45
+ /// Returns a value of type `T`. However, this function never actually returns a
46
+ /// value as it always causes a panic.
47
+ #cfg (target = "native" )
48
+ pub fn [T ] abort (msg : String ) -> T {
49
+ println (msg )
50
+ panic_impl ()
51
+ }
52
+
31
53
///|
32
54
fn [T ] panic_impl () -> T = "%panic"
You can’t perform that action at this time.
0 commit comments