Home
last modified time | relevance | path

Searched refs:unwrap (Results 1 – 25 of 65) sorted by relevance

123

/linux/scripts/
H A Drustdoc_test_gen.rs58 let potential_components: Vec<&str> = file.strip_suffix("_rs").unwrap().split('_').collect(); in find_real_path()
100 [valid_path] => valid_path.to_str().unwrap(), in find_real_path()
106 writeln!(&mut candidates, " {path:?}").unwrap(); in find_real_path()
117 let srctree = std::env::var("srctree").unwrap(); in main()
121 .unwrap() in main()
122 .map(|entry| entry.unwrap().path()) in main()
139 let name = path.file_name().unwrap().to_str().unwrap().to_string(); in main()
142 let (file, line) = name.rsplit_once('_').unwrap().0.rsplit_once('_').unwrap(); in main()
[all...]
H A Drustdoc_test_builder.rs23 stdin.read_to_string(&mut body).unwrap(); in main()
73 let name = rustdoc_function_name.split_once("_rust_kernel_").unwrap().1; in main()
77 std::fs::write(path, body.as_bytes()).unwrap(); in main()
H A Dgenerate_rust_target.rs144 if handle.read_line(&mut line).unwrap() == 0 { in from_stdin()
175 .unwrap() in rustc_version_atleast()
177 .unwrap(); in rustc_version_atleast()
/linux/rust/zerocopy/src/
H A Dref.rs1009 let r = Ref::<&mut [u8], u8>::from_bytes(&mut buf).unwrap(); in test_mut_slice_into_ref()
1019 let r = Ref::<_, u8>::from_bytes(&buf[..]).unwrap(); in test_address()
1025 let r = Ref::<_, [u8]>::from_bytes(&buf[..]).unwrap(); in test_address()
1095 test_new_helper(Ref::<_, AU64>::from_bytes(&mut buf.t[..]).unwrap()); in test_new_aligned_sized()
1099 let (r, suffix) = Ref::<_, AU64>::from_prefix(&mut buf.t[..]).unwrap(); in test_new_aligned_sized()
1105 let (prefix, r) = Ref::<_, AU64>::from_suffix(&mut buf.t[..]).unwrap(); in test_new_aligned_sized()
1118 test_new_helper_slice(Ref::<_, [AU64]>::from_bytes(&mut buf.t[..]).unwrap(), 3); in test_new_aligned_sized()
1120 let r = Ref::<_, [AU64]>::from_bytes_with_elems(&mut buf.t[..], 3).unwrap(); in test_new_aligned_sized()
1123 let ascending: [u8; 24] = (0..24).collect::<Vec<_>>().try_into().unwrap(); in test_new_aligned_sized()
1132 let (r, suffix) = Ref::<_, [AU64]>::from_prefix_with_elems(&mut buf.t[..], 1).unwrap(); in test_new_aligned_sized()
[all …]
H A Dsplit_at.rs972 let dst = SliceDst::<OFFSET>::ref_from_bytes(&arr[..]).unwrap(); in test_split_at()
974 let (l, r) = dst.split_at(i).unwrap().via_runtime_check().unwrap(); in test_split_at()
985 let dst = SliceDst::<OFFSET>::mut_from_bytes(&mut arr[..]).unwrap(); in test_split_at()
987 let (l, r) = dst.split_at_mut(i).unwrap().via_runtime_check().unwrap(); in test_split_at()
1017 let dst = SliceDst::ref_from_bytes(arr.as_bytes()).unwrap(); in test_split_at_overlapping()
1020 let split = dst.split_at(i).unwrap().via_runtime_check(); in test_split_at_overlapping()
1060 let packet = Packet::ref_from_bytes(&arr[..]).unwrap(); in test_split_at_via_methods()
1062 let split1 = packet.split_at(2).unwrap(); in test_split_at_via_methods()
1067 let split2 = packet.split_at(2).unwrap(); in test_split_at_via_methods()
1083 let packet = Packet::ref_from_bytes(&arr[..]).unwrap(); in test_split_at_via_unaligned()
[all …]
H A Dmacros.rs1388 SliceDst::<U16, [u8; 2]>::ref_from_bytes(&[0, 1, 2, 3, 4, 5][..]).unwrap(); in test_transmute_ref()
1390 SliceDst::<U16, U16>::ref_from_bytes(&[0, 1, 2, 3, 4, 5][..]).unwrap(); in test_transmute_ref()
1395 SliceDst::<U16, u8>::ref_from_bytes(&[0, 1, 2, 3, 4, 5][..]).unwrap(); in test_transmute_ref()
1403 let slice_of_u16s: &[U16] = <[U16]>::ref_from_bytes(&[0, 1, 2, 3, 4, 5][..]).unwrap(); in test_transmute_ref()
1409 let slice_dst_big = SliceDst::<U32, U16>::ref_from_bytes(bytes).unwrap(); in test_transmute_ref()
1410 let slice_dst_small = SliceDst::<U16, u8>::ref_from_bytes(bytes).unwrap(); in test_transmute_ref()
1444 assert_eq!(x.unwrap(), 1); in test_try_transmute()
1446 assert_eq!(x.unwrap().into_inner(), 1); in test_try_transmute()
1448 assert_eq!(x.unwrap().into_inner(), 1); in test_try_transmute()
1520 SliceDst::<U16, [u8; 2]>::ref_from_bytes(&[0, 1, 2, 3, 4, 5][..]).unwrap(); in test_try_transmute_ref()
[all …]
H A Dlib.rs6512 align: NonZeroUsize::new(align).unwrap(), in test_known_layout()
6586 align: NonZeroUsize::new(align).unwrap(), in test_known_layout_derive()
6592 align: NonZeroUsize::new(align).unwrap(), in test_known_layout_derive()
6958 <[bool]>::new_box_zeroed_with_elems(3).unwrap().as_ref(), in test_from_zeros_only()
6962 <[char]>::new_box_zeroed_with_elems(3).unwrap().as_ref(), in test_from_zeros_only()
6966 assert_eq!(bool::new_vec_zeroed(3).unwrap().as_ref(), [false, false, false]); in test_from_zeros_only()
6967 assert_eq!(char::new_vec_zeroed(3).unwrap().as_ref(), ['\0', '\0', '\0']); in test_from_zeros_only()
6988 assert_eq!(<[()]>::new_box_zeroed_with_elems(3).unwrap().len(), 3); in test_zst_count_preserved()
6990 assert_eq!(<()>::new_vec_zeroed(3).unwrap().len(), 3); in test_zst_count_preserved()
6993 assert_eq!(<[()]>::ref_from_bytes_with_elems(&[][..], 3).unwrap().len(), 3); in test_zst_count_preserved()
[all …]
H A Dlayout.rs1143 align: NonZeroUsize::new(align).unwrap(), in test_dst_layout_extend_sized_with_sized()
1192 let aligns = (0..29).map(|p| NonZeroUsize::new(2usize.pow(p)).unwrap()); in test_dst_layout_extend_sized_with_dst()
1216 align: NonZeroUsize::new(align).unwrap(), in test_dst_layout_extend_sized_with_dst()
1235 for align in (0..29).map(|p| NonZeroUsize::new(2usize.pow(p)).unwrap()) { in test_dst_layout_pad_to_align_with_sized()
1259 align: NonZeroUsize::new($unpadded_align).unwrap(), in test_dst_layout_pad_to_align_with_sized()
1268 align: NonZeroUsize::new($padded_align).unwrap(), in test_dst_layout_pad_to_align_with_sized()
1298 for align in (0..29).map(|p| NonZeroUsize::new(2usize.pow(p)).unwrap()) { in test_dst_layout_pad_to_align_with_dst()
1335 align: NonZeroUsize::new(align).unwrap(), in test_validate_cast_and_convert_metadata()
1662 unsafe { slc_field_ptr.byte_offset_from(ptr.as_ptr()).try_into().unwrap() }; in test_validate_rust_layout()
1708 .unwrap(); in test_validate_rust_layout()
[all …]
/linux/rust/kernel/alloc/
H A Dkvec.rs1549 let mut vec1: KVec<usize> = KVec::with_capacity(c.len(), GFP_KERNEL).unwrap(); in test_kvvec_shrink_to()
1550 let mut vec2: KVec<usize> = KVec::with_capacity(c.len(), GFP_KERNEL).unwrap(); in test_kvvec_shrink_to()
1553 vec1.push_within_capacity(i).unwrap(); in test_kvvec_shrink_to()
1555 vec2.push_within_capacity(i).unwrap();
1577 let mut func = KVec::with_capacity(10, GFP_KERNEL).unwrap(); in test_kvvec_shrink_to_no_op()
1583 func.push_within_capacity(false).unwrap(); in test_kvvec_shrink_to_no_op()
1592 let mut v = KVVec::<u8>::with_capacity(PAGE_SIZE * 4, GFP_KERNEL).unwrap(); in test_kvvec_shrink_to_respects_min_capacity()
1595 v.push(1, GFP_KERNEL).unwrap(); in test_kvvec_shrink_to_respects_min_capacity()
1596 v.push(2, GFP_KERNEL).unwrap(); in test_kvvec_shrink_to_respects_min_capacity()
1597 v.push(3, GFP_KERNEL).unwrap(); in test_kvvec_shrink_to_respects_min_capacity()
[all...]
/linux/rust/macros/
H A Dvtable.rs
H A Dpin_data.rs
H A Dpinned_drop.rs
/linux/drivers/android/binder/range_alloc/
H A Dtree.rs50 let free_node = alloc.free_tree.pop().unwrap(); in from_array()
53 let tree_node = alloc.tree.pop().unwrap(); in from_array()
64 let free_res = alloc.free_tree.pop().unwrap(); in from_array()
65 let tree_node = alloc.tree.pop().unwrap(); in from_array()
74 let free_node = alloc.free_tree.pop().unwrap(); in from_array()
77 let tree_node = alloc.tree.pop().unwrap(); in from_array()
89 let first_value = tree_iter.next().unwrap(); in is_empty()
/linux/net/sunrpc/auth_gss/
H A Dgss_krb5_mech.c314 * @len: size of ciphertext to unwrap in gss_krb5_import_ctx_v2()
315 * @buf: ciphertext to unwrap in gss_krb5_import_ctx_v2()
/linux/rust/kernel/
H A Dtypes.rs242 self.0.take().unwrap().0
257 // The type invariants guarantee that `unwrap` will succeed. in deref_mut()
258 &self.0.as_ref().unwrap().0
264 // The type invariants guarantee that `unwrap` will succeed. in drop()
265 &mut self.0.as_mut().unwrap().0 in drop()
/linux/fs/ecryptfs/
H A DKconfig18 bool "Enable notifications for userspace key wrap/unwrap"
22 for userspace to wrap/unwrap file encryption keys by other
/linux/rust/syn/
H A Dattr.rs250 path.segments.first().unwrap().ident.span(), in parse_args_with()
251 path.segments.last().unwrap().ident.span(), in parse_args_with()
538 path.segments.first().unwrap().ident.span(), in require_list()
539 path.segments.last().unwrap().ident.span(), in require_list()
556 path.segments.first().unwrap().ident.span(), in require_name_value()
557 path.segments.last().unwrap().ident.span(), in require_name_value()
H A Dclassify.rs108 match &path.segments.last().unwrap().arguments { in trailing_unparameterized_path()
121 match bounds.last().unwrap() { in trailing_unparameterized_path()
282 match &path.segments.last().unwrap().arguments { in expr_trailing_brace()
294 match bounds.last().unwrap() { in expr_trailing_brace()
H A Dverbatim.rs15 let (tt, next) = cursor.token_tree().unwrap(); in between()
H A Dlit.rs422 let mut token: Literal = repr.parse().unwrap(); in new()
516 let mut token: Literal = repr.parse().unwrap(); in new()
909 let mut token: Literal = repr.parse().unwrap(); in parse_negative_lit()
924 let mut token: Literal = repr.parse().unwrap(); in parse_negative_lit()
1302 char::from_u32(u32::from(byte)).unwrap() in parse_lit_str_cooked()
1358 let close = s.rfind('"').unwrap(); in parse_lit_str_raw()
1518 (CString::new(out).unwrap(), suffix) in parse_lit_c_str_cooked()
1524 (CString::new(String::from(value)).unwrap(), suffix) in parse_lit_c_str_raw()
1583 char::from_u32(u32::from(byte)).unwrap() in parse_lit_char()
1853 let mut digits = String::from_utf8(bytes).unwrap(); in parse_lit_float()
H A Dwhitespace.rs52 let ch = s.chars().next().unwrap(); in skip()
/linux/rust/zerocopy/src/pointer/
H A Dinner.rs638 let dst = <[u8]>::ref_from_bytes(&arr[..]).unwrap(); in test_meta()
660 let dst = SliceDst::<OFFSET>::ref_from_bytes(&arr[..]).unwrap(); in test_split_at()
712 let dst = SliceDst::<OFFSET>::ref_from_bytes(&arr[..]).unwrap(); in test_trailing_slice()
728 isize::try_from(OFFSET).unwrap(), in test_trailing_slice()
/linux/rust/pin-init/examples/
H A Dstatic_init.rs87 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); in main()
H A Dbig_struct_in_place.rs40 .unwrap(); in main()
/linux/rust/pin-init/src/
H A D__internal.rs211 let value = value.unwrap();
218 let value = value.unwrap(); in stack_init_reuse()

123