File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -258,15 +258,15 @@ impl IntType {
258
258
///
259
259
/// assert_eq!(i8_val.print_to_string().to_string(), "i8 121");
260
260
///
261
- /// let i8_val = i8_type.const_int_from_string("0121", StringRadix::from_u8(10).unwrap());
261
+ /// let i8_val = i8_type.const_int_from_string("0121", StringRadix::from_u8(10).unwrap()).unwrap() ;
262
262
///
263
263
/// assert_eq!(i8_val.print_to_string().to_string(), "i8 16");
264
264
///
265
- /// // Unsafe executions, LLVM may terminate with an assertion failure or
266
- /// // execute undefined behaviour in C++ code.
267
265
/// let i8_val = i8_type.const_int_from_string("0121", StringRadix::Binary);
266
+ /// assert!(i8_val.is_none());
268
267
///
269
268
/// let i8_val = i8_type.const_int_from_string("ABCD", StringRadix::Binary);
269
+ /// assert!(i8_val.is_none());
270
270
/// ```
271
271
pub fn const_int_from_string ( & self , slice : & str , radix : StringRadix ) -> Option < IntValue > {
272
272
if !radix. to_regex ( ) . is_match ( slice) {
Original file line number Diff line number Diff line change @@ -738,15 +738,14 @@ fn test_value_from_string() {
738
738
let f64_val = f64_type. const_float_from_string ( "3" ) ;
739
739
740
740
assert_eq ! ( f64_val. print_to_string( ) . to_string( ) , "double 3.000000e+00" ) ;
741
- /*
741
+
742
742
let f64_val = f64_type. const_float_from_string ( "" ) ;
743
743
744
744
assert_eq ! ( f64_val. print_to_string( ) . to_string( ) , "double 0.000000e+00" ) ;
745
745
746
746
let f64_val = f64_type. const_float_from_string ( "3.asd" ) ;
747
747
748
748
assert_eq ! ( f64_val. print_to_string( ) . to_string( ) , "double 0x7FF0000000000000" ) ;
749
- */
750
749
}
751
750
752
751
#[ test]
You can’t perform that action at this time.
0 commit comments