Home
last modified time | relevance | path

Searched full:let (Results 1 – 25 of 2319) sorted by relevance

12345678910>>...93

/linux/rust/proc-macro2/
H A Dparse.rs20 let (_front, rest) = self.rest.split_at(bytes); in advance()
80 let mut s = input; in skip_whitespace()
83 let byte = s.as_bytes()[0]; in skip_whitespace()
89 let (cursor, _) = take_until_newline_or_eof(s); in skip_whitespace()
115 let ch = s.chars().next().unwrap(); in skip_whitespace()
132 let mut depth = 0usize; in block_comment()
133 let bytes = input.as_bytes(); in block_comment()
134 let mut i = 0usize; in block_comment()
135 let upper = bytes.len() - 1; in block_comment()
171 let mut trees = TokenStreamBuilder::new(); in token_stream()
[all …]
H A Dfallback.rs78 let mut cursor = get_cursor(src); in from_str_checked()
99 let nodrop = ManuallyDrop::new(self); in take_inner()
122 let mut punct = crate::Punct::new('-', Spacing::Alone); in push_token_from_proc_macro()
132 let mut stack = Vec::new(); in drop()
133 let mut current = match self.inner.get_mut() { in drop()
138 while let Some(token) = current.next() { in drop()
139 let group = match token { in drop()
144 let group = match group { in drop()
148 let mut group = group; in drop()
149 if let Some(inner) = group.stream.inner.get_mut() { in drop()
[all …]
/linux/drivers/android/binder/
H A Dprocess.rs177 if let Some(thread) = self.ready_threads.pop_front() { in push_work()
187 let sync = work.should_sync_wakeup(); in push_work()
225 let push = node.update_refcount_locked(inc, strong, count, self); in update_node_refcount()
229 if let Some(node) = push { in update_node_refcount()
230 if let Some(thread) = othread { in update_node_refcount()
233 let _ = self.push_work(node); in update_node_refcount()
247 let strong_count = if strong { 1 } else { 0 }; in new_node_ref()
258 let push = match wrapper { in new_node_ref_with_thread()
264 if let Some(node) = push { in new_node_ref_with_thread()
267 let strong_count = if strong { 1 } else { 0 }; in new_node_ref_with_thread()
[all …]
H A Dfreeze.rs90 let _removed_listener; in do_work()
91 let mut node_refs = thread.process.node_refs.lock(); in do_work()
92 let Some(mut freeze_entry) = node_refs.freeze_listeners.find_mut(&self.cookie) else { in do_work()
95 let freeze = freeze_entry.get_mut(); in do_work()
124 let is_frozen = freeze.node.owner.inner.lock().is_frozen.is_fully_frozen(); in do_work()
129 let mut state_info = BinderFrozenStateInfo::default(); in do_work()
169 let hc = reader.read::<BinderHandleCookie>()?; in request_freeze_notif()
170 let handle = hc.handle; in request_freeze_notif()
171 let cookie = FreezeCookie(hc.cookie); in request_freeze_notif()
173 let msg = FreezeMessage::new(GFP_KERNEL)?; in request_freeze_notif()
[all …]
H A Dthread.rs153 let ancestors_i = self in validate_parent_fixup()
159 let sg_idx = self.ancestors[ancestors_i]; in validate_parent_fixup()
160 let sg_entry = match self.sg_entries.get(sg_idx) { in validate_parent_fixup()
180 let new_min_offset = parent_offset.checked_add(length).ok_or(EINVAL)?; in validate_parent_fixup()
189 let target_offset = sg_entry.offset.checked_add(parent_offset).ok_or(EINVAL)?; in validate_parent_fixup()
215 let size = ptr_align(size).ok_or(EINVAL)?; in claim_next()
216 let new_offset = self.offset.checked_add(size).ok_or(EINVAL)?; in claim_next()
219 let offset = self.offset; in claim_next()
306 let ret = self.work_list.pop_front(); in pop_work()
322 if let Ok(work) = ListArc::try_from_arc(self.reply_work.clone()) { in push_reply_work()
[all …]
H A Dpage_range.rs75 let ret = unsafe { bindings::__list_lru_init(self.list_lru.get(), false, ptr::null_mut()) }; in register()
81 let shrinker = unsafe { bindings::shrinker_alloc(0, name.as_char_ptr()) }; in register()
152 let vm_ops = unsafe { (*vma.as_ptr()).vm_ops }; in check_vma()
158 let vm_private_data = unsafe { (*vma.as_ptr()).vm_private_data }; in check_vma()
209 let ptr = unsafe { &raw mut (*me).page }; in set_page()
227 let ptr = unsafe { &raw const (*me).page }; in get_page()
238 let ptr = unsafe { &raw mut (*me).page }; in take_page()
251 let lru_ptr = unsafe { &raw mut (*me).lru }; in list_lru_add()
263 let lru_ptr = unsafe { &raw mut (*me).lru }; in list_lru_del()
290 let mm_lock = unsafe { &*ptr::from_ref(&self.mm_lock) }; in stable_trylock_mm()
[all …]
/linux/tools/memory-model/
H A Dlinux-kernel.cat28 let acq-po = [Acquire] ; po ; [M]
29 let po-rel = [M] ; po ; [Release]
30 let po-unlock-lock-po = po ; [UL] ; (po|rf) ; [LKR] ; po
33 let R4rmb = R \ Noreturn (* Reads for which rmb works *)
34 let rmb = [R4rmb] ; fencerel(Rmb) ; [R4rmb]
35 let wmb = [W] ; fencerel(Wmb) ; [W]
36 let mb = ([M] ; fencerel(Mb) ; [M]) |
64 let gp = po ; [Sync-rcu | Sync-srcu] ; po?
65 let strong-fence = mb | gp
67 let nonr
[all...]
H A Dlock.cat33 let RL = try RL with emptyset
34 let RU = try RU with emptyset
37 let LF = LF | RL
40 let ALL-LOCKS = LKR | LKW | UL | LF | RU | Srcu-lock | Srcu-unlock | Sync-srcu
44 let lk-rmw = ([LKR] ; po-loc ; [LKW]) \ (po ; po)
45 let rmw = rmw | lk-rmw
70 let R = R | LKR | LF | RU
71 let W = W | LKW
73 let Release = Release | UL
74 let Acquire = Acquire | LKR
[all …]
/linux/rust/syn/
H A Ditem.rs814 let arg = self.inputs.first()?; in receiver()
942 let begin = input.fork(); in parse()
943 let attrs = input.call(Attribute::parse_outer)?; in parse()
953 let ahead = input.fork(); in parse_rest_of_item()
954 let vis: Visibility = ahead.parse()?; in parse_rest_of_item()
956 let lookahead = ahead.lookahead1(); in parse_rest_of_item()
957 let allow_safe = false; in parse_rest_of_item()
958 let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead, allow_safe) { in parse_rest_of_item()
959 let vis: Visibility = input.parse()?; in parse_rest_of_item()
960 let sig: Signature = input.parse()?; in parse_rest_of_item()
[all …]
H A Dty.rs300 let allow_plus = true; in parse()
301 let allow_group_generic = true; in parse()
314 let allow_plus = false; in without_plus()
315 let allow_group_generic = true; in without_plus()
325 let begin = input.fork(); in ambig_ty()
328 let mut group: TypeGroup = input.parse()?; in ambig_ty()
330 if let Type::Path(mut ty) = *group.elem { in ambig_ty()
348 if let Type::Path(mut ty) = *group.elem { in ambig_ty()
349 let arguments = &mut ty.path.segments.last_mut().unwrap().arguments; in ambig_ty()
362 let mut lifetimes = None::<BoundLifetimes>; in ambig_ty()
[all …]
H A Dstmt.rs24 /// A local (let) binding.
36 /// macro would expand to. It can be any of local variable (`let`),
43 /// A local `let` binding: `let x: u64 = s.parse()?;`.
47 pub let_token: Token![let],
55 /// The expression assigned in a local `let` binding, including optional
58 /// `LocalInit` represents `= s.parse()?` in `let x: u64 = s.parse()?` and
59 /// `= r else { return }` in `let Ok(x) = r else { return }`.
72 /// would expand to. It can be any of local variable (`let`), item, or
115 /// // let mut x = 1;
129 /// let outer_attrs = input.call(Attribute::parse_outer)?;
[all …]
H A Dlit.rs136 let mut token = Literal::string(value); in new()
147 let repr = self.repr.token.to_string(); in value()
148 let (value, _suffix) = value::parse_lit_str(&repr); in value()
171 /// if let Meta::NameValue(meta) = &attr.meta {
172 /// if let Expr::Lit(expr) = &meta.value {
173 /// if let Lit::Str(lit_str) = &expr.lit {
179 /// let message = "expected #[path = \"...\"]";
200 /// # let lit_str = LitStr::new("a::b::c", Span::call_site());
203 /// let lit_str: LitStr = /* ... */;
208 /// let basic_path = lit_str.parse_with(syn::Path::parse_mod_style)?;
[all …]
H A Dexpr.rs53 /// let expr: Expr = /* ... */;
103 /// // assigning `*discriminant.base` without an `if let`.
104 /// if let Expr::Tuple(base) = *discriminant.base {
179 /// A `let` guard: `let Some(x) = opt`.
180 Let(ExprLet),
484 /// A `let` guard: `let Some(x) = opt`.
488 pub let_token: Token![let],
727 /// while let Expr::Paren(paren) = e {
733 /// let mut e: Expr = parse_quote! { ((1 + 1)) };
767 /// let _ = *S {};
[all …]
H A Dderive.rs84 let attrs = input.call(Attribute::parse_outer)?; in parse()
85 let vis = input.parse::<Visibility>()?; in parse()
87 let lookahead = input.lookahead1(); in parse()
89 let struct_token = input.parse::<Token![struct]>()?; in parse()
90 let ident = input.parse::<Ident>()?; in parse()
91 let generics = input.parse::<Generics>()?; in parse()
92 let (where_clause, fields, semi) = data_struct(input)?; in parse()
108 let enum_token = input.parse::<Token![enum]>()?; in parse()
109 let ident = input.parse::<Ident>()?; in parse()
110 let generics = input.parse::<Generics>()?; in parse()
[all …]
H A Dfixup.rs36 // let _ = match x {} - 1; // no parens
44 // Example: `let _ = $match - 1;`
98 // if let _ = (Struct {}) {} // needs parens
101 // () if let _ = Struct {} => {} // no parens
127 // let _ = (return) - 1; // without paren, this would return -1
129 // let _ = return + 1; // no paren because '+' cannot begin expr
136 // let _ = 1 + return 1; // no parens if rightmost subexpression
138 // let _ = 1 + (return 1) + 1; // needs parens
145 // let _ = x as u8 + T;
147 // let _ = (x as u8) < T;
[all …]
H A Dgenerics.rs165 /// # let generics: syn::Generics = Default::default();
166 /// # let name = Ident::new("MyType", Span::call_site());
168 /// let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
193 if let GenericParam::Lifetime(lifetime) = self.0.next()? { in next()
207 if let GenericParam::Lifetime(lifetime) = self.0.next()? { in next()
221 if let GenericParam::Type(type_param) = self.0.next()? { in next()
235 if let GenericParam::Type(type_param) = self.0.next()? { in next()
249 if let GenericParam::Const(const_param) = self.0.next()? { in next()
263 if let GenericParam::Const(const_param) = self.0.next()? { in next()
546 let lt_token: Token![<] = input.parse()?; in parse()
[all …]
/linux/rust/macros/
H A Dfmt.rs10 let mut input = input.into_iter(); in fmt()
12 let first_opt = input.next(); in fmt()
13 let first_owned_str; in fmt()
14 let mut names = BTreeSet::new(); in fmt()
15 let first_span = { in fmt()
16 let Some((mut first_str, first_span)) = (match first_opt.as_ref() { in fmt()
20 let first = first.strip_prefix('"')?; in fmt()
21 let first = first.strip_suffix('"')?; in fmt()
33 while let Some((_, rest)) = first_str.split_once('{') { in fmt()
35 if let Som in fmt()
[all...]
/linux/rust/pin-init/internal/src/
H A Dinit.rs85 let error = error.map_or_else(
87 if let Some(default_error) = attrs.iter().fold(None, |acc, attr| {
89 if let InitializerAttribute::DefaultError(DefaultErrorAttribute { ty }) = attr {
96 } else if let Some(default_error) = default_error {
105 let slot = format_ident!("slot");
106 let (has_data_trait, data_trait, get_data, init_from_closure) = if pinned {
121 let init_kind = get_init_kind(rest, dcx);
122 let zeroable_check = match init_kind {
138 let this = match this {
143 let #ident = unsafe { ::core::ptr::NonNull::new_unchecked(slot) };
[all …]
/linux/drivers/android/binder/range_alloc/
H A Dtree.rs39 let mut tree = TreeRangeAllocator { in from_array()
46 let mut free_offset = 0; in from_array()
48 let free_size = range.offset - free_offset; in from_array()
50 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()
66 let mut desc = Descriptor::new(range.offset, range.size); in from_array()
73 let free_size = size - free_offset; in from_array()
74 let free_node = alloc.free_tree.pop().unwrap(); in from_array()
[all …]
H A Darray.rs75 if let DescriptorState::Reserved(_) = range.state { in debug_print()
91 let after_last_range = self.ranges.last().map(Range::endpoint).unwrap_or(0); in find_empty_range()
100 let mut end_of_prev = 0; in find_empty_range()
123 let new_oneway_space = if is_oneway { in reserve_new()
132 let FindEmptyRes { in reserve_new()
138 let new_range = Range { in reserve_new()
155 let oneway_spam_detected = in reserve_new()
168 let mut total_alloc_size = 0; in low_oneway_space()
169 let mut num_buffers = 0; in low_oneway_space()
185 let i = self in reservation_abort()
[all …]
/linux/samples/rust/
H A Drust_driver_platform.rs111 let dev = pdev.as_ref(); in probe()
115 if let Some(info) = info { in probe()
129 let fwnode = dev.fwnode().ok_or(ENOENT)?; in properties_parse()
131 if let Ok(idx) = fwnode.property_match_string(c"compatible", c"test,rust-device") { in properties_parse()
135 let name = c"compatible"; in properties_parse()
136 let prop = fwnode.property_read::<CString>(name).required_by(dev)?; in properties_parse()
139 let name = c"test,bool-prop"; in properties_parse()
140 let prop = fwnode.property_read_bool(c"test,bool-prop"); in properties_parse()
147 let name = c"test,u32-optional-prop"; in properties_parse()
148 let pro in properties_parse()
[all...]
H A Drust_debugfs_scoped.rs36 let mut buf = [0u8; 128]; in remove_file_write()
40 let n = reader.len(); in remove_file_write()
43 let s = core::str::from_utf8(&buf[..n]).map_err(|_| EINVAL)?.trim(); in remove_file_write()
44 let nul_idx = s.len(); in remove_file_write()
46 let to_remove = CStr::from_bytes_with_nul(&buf[..nul_idx + 1]).map_err(|_| EINVAL)?; in create_file_write()
58 let mut buf = [0u8; 128]; in create_file_write()
62 let n = reader.len(); in create_file_write()
65 let mut nums = KVec::new(); in create_file_write()
67 let s = core::str::from_utf8(&buf[..n]).map_err(|_| EINVAL)?.trim(); in create_file_write()
68 let mu in create_file_write()
[all...]
/linux/rust/kernel/alloc/
H A Dkvec.rs38 /// let mut v = kernel::kvec![];
42 /// let mut v = kernel::kvec![1; 3]?;
46 /// let mut v = kernel::kvec![1, 2, 3]?;
120 /// let mut v = KVec::new();
133 /// let mut v = VVec::new();
146 /// let mut v = KVVec::new();
234 /// let mut v = KVec::new();
270 /// let mut v = KVec::new();
305 let ptr = unsafe { self.as_mut_ptr().add(self.len) }.cast::<MaybeUninit<T>>(); in spare_capacity_mut()
317 /// let mut v = KVec::new();
[all …]
/linux/rust/kernel/io/
H A Dmem.rs69 /// let offset = 0; // Some offset.
74 /// let request = pdev.io_request_by_index(0).ok_or(ENODEV)?;
75 /// let iomem = request.iomap_sized::<42>();
76 /// let iomem = KBox::pin_init(iomem, GFP_KERNEL)?;
78 /// let io = iomem.access(pdev.as_ref())?;
81 /// let data = io.read32_relaxed(offset);
132 /// let offset = 0; // Some offset.
138 /// let request = pdev.io_request_by_index(0).ok_or(ENODEV)?;
139 /// let iomem = request.iomap();
140 /// let iome
[all...]
/linux/rust/kernel/
H A Dmaple_tree.rs57 let first = match range.start_bound() { in to_maple_range()
63 let last = match range.end_bound() { in to_maple_range()
103 /// let tree = KBox::pin_init(MapleTree::<KBox<i32>>::new(), GFP_KERNEL)?;
105 /// let ten = KBox::new(10, GFP_KERNEL)?;
106 /// let twenty = KBox::new(20, GFP_KERNEL)?;
107 /// let the_answer = KBox::new(42, GFP_KERNEL)?;
142 /// let tree = KBox::pin_init(MapleTree::<KBox<i32>>::new(), GFP_KERNEL)?;
144 /// let ten = KBox::new(10, GFP_KERNEL)?;
145 /// let twenty = KBox::new(20, GFP_KERNEL)?;
146 /// let the_answer = KBox::new(42, GFP_KERNEL)?;
[all …]

12345678910>>...93