diff --git a/builtin/option.mbt b/builtin/option.mbt index 4e264cd60..b7e521b31 100644 --- a/builtin/option.mbt +++ b/builtin/option.mbt @@ -31,7 +31,7 @@ pub fn Option::to_string[X : Show](self : X?) -> String { ///| /// Extract the value in `Some`. -/// Panic if input is `None`. +/// @alert unsafe "Panic if input is `None`." pub fn Option::unwrap[X](self : X?) -> X { match self { None => panic() diff --git a/builtin/string.mbt b/builtin/string.mbt index 53e4e9388..9bcb09c81 100644 --- a/builtin/string.mbt +++ b/builtin/string.mbt @@ -70,7 +70,7 @@ fn code_point_of_surrogate_pair(leading : Int, trailing : Int) -> Char { /// /// # Panics /// -/// Panics if the index is out of bounds. +/// @alert unsafe "Panics if the index is out of bounds." pub fn charcode_at(self : String, index : Int) -> Int { guard index >= 0 && index < self.length() else { abort("index out of bounds") diff --git a/immut/priority_queue/priority_queue.mbt b/immut/priority_queue/priority_queue.mbt index 0d47cd080..440f4437f 100644 --- a/immut/priority_queue/priority_queue.mbt +++ b/immut/priority_queue/priority_queue.mbt @@ -127,7 +127,7 @@ pub fn pop[A : Compare](self : T[A]) -> T[A]? { ///| /// Pops the first value from the immutable priority queue. /// -/// Panics if the queue is empty. +/// @alert unsafe "Panics if the queue is empty." /// # Example /// ``` /// let queue = @priority_queue.of([1, 2, 3, 4]) diff --git a/string/string.mbt b/string/string.mbt index c37eee940..8b3232940 100644 --- a/string/string.mbt +++ b/string/string.mbt @@ -692,7 +692,7 @@ pub fn pad_end(self : String, total_width : Int, padding_char : Char) -> String /// /// # Panics /// -/// Panics if the index is out of bounds. +/// @alert unsafe "Panics if the index is out of bounds." pub fn String::rev_get(self : String, index : Int) -> Char { guard index >= 0 else { abort("index out of bounds") } for utf16_offset = self.charcode_length() - 1, char_count = 0