Home
last modified time | relevance | path

Searched full:span (Results 1 – 25 of 337) sorted by relevance

12345678910>>...14

/linux/rust/proc-macro2/
H A Dwrapper.rs172 punct.set_span(tt.span().inner.unwrap_nightly()); in into_compiler_token()
267 pub(crate) fn span(&self) -> Span { in span() argument
269 LexError::Compiler(_) | LexError::CompilerPanic => Span::call_site(), in span()
270 LexError::Fallback(e) => Span::Fallback(e.span()), in span()
351 o.set_span(crate::Span::_new(Span::Compiler(tt.span()))); in next()
372 pub(crate) enum Span { enum
373 Compiler(proc_macro::Span),
374 Fallback(fallback::Span),
377 impl Span { impl
380 Span::Compiler(proc_macro::Span::call_site()) in call_site()
[all …]
H A Dfallback.rs54 pub(crate) span: Span, field
58 pub(crate) fn span(&self) -> Span { in span() argument
59 self.span in span()
64 span: Span::call_site(), in call_site()
123 punct.set_span(crate::Span::_new_fallback(literal.span)); in push_token_from_proc_macro()
199 let span = sm.add_file(src); in get_cursor() localVariable
202 off: span.lo, in get_cursor()
325 span: Span { lo: 0, hi: 0 },
341 span: Span, field
349 assert!(self.span_within(Span { in offset_line_column()
[all …]
H A Dextra.rs9 use crate::Span;
12 /// Invalidate any `proc_macro2::Span` that exist on the current thread.
14 /// The implementation of `Span` uses thread-local data structures and this
15 /// function clears them. Calling any method on a `Span` on the current thread
22 /// gigabytes). After a wraparound, `Span` methods such as `source_text()` can
74 #[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))]
93 join: proc_macro::Span,
94 open: proc_macro::Span,
95 close: proc_macro::Span,
97 Fallback(fallback::Span),
[all …]
H A Dlib.rs187 #[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))]
330 pub fn span(&self) -> Span { in span() argument
331 Span::_new(self.inner.span()) in span()
351 pub struct Span { struct
352 inner: imp::Span, argument
356 impl Span { impl
357 fn _new(inner: imp::Span) -> Self { in _new()
358 Span { in _new()
364 fn _new_fallback(inner: fallback::Span) -> Self { in _new_fallback()
365 Span { in _new_fallback()
[all …]
/linux/rust/syn/
H A Dspan.rs4 use proc_macro2::{Delimiter, Group, Span, TokenStream};
11 impl IntoSpans<Span> for Span { implementation
12 fn into_spans(self) -> Span { in into_spans() argument
17 impl IntoSpans<[Span; 1]> for Span { implementation
18 fn into_spans(self) -> [Span; 1] { in into_spans()
23 impl IntoSpans<[Span; 2]> for Span { implementation
24 fn into_spans(self) -> [Span; 2] { in into_spans()
29 impl IntoSpans<[Span; 3]> for Span { implementation
30 fn into_spans(self) -> [Span; 3] { in into_spans()
35 impl IntoSpans<[Span; 1]> for [Span; 1] { implementation
[all …]
H A Dspanned.rs3 //! A trait that can provide the `Span` of the complete contents of a syntax
28 //! use proc_macro2::Span;
40 //! let assert_sync = quote_spanned! {ty.span()=>
65 //! In this technique, using the `Type`'s span for the error message makes the
72 //! The underlying [`proc_macro::Span::join`] method is nightly-only. When
74 //! use `join` to produce the intended span. When not using a nightly compiler,
75 //! only the span of the *first token* of the syntax tree node is returned.
77 //! In the common case of wanting to use the joined span as the span of a
79 //! able to span the error correctly under the complete syntax tree node without
84 use proc_macro2::Span;
[all …]
H A Derror.rs7 Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree,
107 // Span is implemented as an index into a thread-local interner to keep the
110 // handling, so pin the span we're given to its original thread and assume
111 // it is Span::call_site if accessed from any other thread.
112 span: ThreadBound<SpanRange>, field
116 // Cannot use std::ops::Range<Span> because that does not implement Copy,
120 start: Span,
121 end: Span,
131 /// automatically uses the correct span from the current position of the
134 /// Use `Error::new` when the error needs to be triggered on some span other
[all …]
H A Dlit.rs8 use proc_macro2::{Ident, Literal, Span};
130 pub span: Span,
135 pub fn new(value: &str, span: Span) -> Self { in new()
137 token.set_span(span); in new()
154 /// All spans in the syntax tree will point to the span of this `LitStr`.
191 /// All spans in the syntax tree will point to the span of this `LitStr`.
196 /// # use proc_macro2::Span;
200 /// # let lit_str = LitStr::new("a::b::c", Span::call_site());
218 // Token stream with every span replaced by the given one. in parse_with()
219 fn respan_token_stream(stream: TokenStream, span: Span) -> TokenStream { in parse_with()
[all …]
H A Dlifetime.rs5 use proc_macro2::{Ident, Span};
21 pub apostrophe: Span,
33 /// # use proc_macro2::Span;
37 /// Lifetime::new("'a", Span::call_site())
40 pub fn new(symbol: &str, span: Span) -> Self { in new()
57 apostrophe: span, in new()
58 ident: Ident::new(&symbol[1..], span), in new()
62 pub fn span(&self) -> Span { in span() argument
64 .join(self.ident.span()) in span()
68 pub fn set_span(&mut self, span: Span) { in set_span() argument
[all …]
H A Dtoken.rs84 //! - Construction from a [`Span`] — `let the_token = Token![...](sp)`
86 //! - Field access to its span — `let sp = the_token.span`
91 //! [`Span`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html
104 use crate::span::IntoSpans;
106 use proc_macro2::Span;
140 use proc_macro2::Span;
145 /// Support writing `token.span` rather than `token.spans[0]` on tokens that
146 /// hold a single span.
150 pub span: Span, field
213 pub span: Span,
[all …]
/linux/rust/macros/
H A Dquote.rs42 /// the given span.
48 ($span:expr => $($tt:tt)*) => {{
52 let span = $span; localVariable
53 quote_spanned!(@proc tokens span $($tt)*);
57 (@proc $v:ident $span:ident) => {};
58 (@proc $v:ident $span:ident #$id:ident $($tt:tt)*) => {
60 quote_spanned!(@proc $v $span $($tt)*);
62 (@proc $v:ident $span:ident #(#$id:ident)* $($tt:tt)*) => {
66 quote_spanned!(@proc $v $span $($tt)*);
68 (@proc $v:ident $span:ident ( $($inner:tt)* ) $($tt:tt)*) => {
[all …]
H A Dpaste.rs3 use proc_macro::{Delimiter, Group, Ident, Spacing, Span, TokenTree};
5 fn concat_helper(tokens: &[TokenTree]) -> Vec<(String, Span)> { in concat_helper() argument
8 let mut span = None; in concat_helper() localVariable
19 segments.push((value, lit.span())); in concat_helper()
26 segments.push((value, ident.span())); in concat_helper()
35 // Set the overall span of concatenated token as current span in concat_helper()
36 "span" => { in concat_helper()
38 span.is_none(), in concat_helper()
39 "span modifier should only appear at most once" in concat_helper()
41 span = Some(sp); in concat_helper()
[all …]
/linux/rust/quote/
H A Druntime.rs18 pub type Span = proc_macro2::Span; typedef
196 pub fn get_span<T>(span: T) -> GetSpan<T> { in get_span()
197 GetSpan(GetSpanInner(GetSpanBase(span))) in get_span()
203 use proc_macro2::Span;
211 impl GetSpan<Span> {
213 pub fn __into_span(self) -> Span { in __into_span() argument
220 pub fn __into_span(&self) -> Span { in __into_span() argument
259 span: Span, in push_group_spanned() argument
264 g.set_span(span); in push_group_spanned()
275 pub fn parse_spanned(tokens: &mut TokenStream, span: Span, s: &str) { in parse_spanned() argument
[all …]
H A Dformat.rs41 /// The [`Span`] of the first `Ident` argument is used as the span of the final
42 /// identifier, falling back to [`Span::call_site`] when no identifiers are
48 /// // If `ident` is an Ident, the span of `my_ident` will be inherited from it.
53 /// Alternatively, the span can be overridden by passing the `span` named
61 /// # let my_span = proc_macro2::Span::call_site();
62 /// format_ident!("MyIdent", span = my_span);
65 /// [`Span`]: proc_macro2::Span
66 /// [`Span::call_site`]: proc_macro2::Span::call_site
133 ([$span:expr, $($fmt:tt)*]) => {
136 $span,
[all …]
H A Dlib.rs167 /// Any interpolated tokens preserve the `Span` information provided by their
169 /// invocation are spanned with [`Span::call_site()`].
171 /// [`Span::call_site()`]: proc_macro2::Span::call_site
173 /// A different span can be provided through the [`quote_spanned!`] macro.
278 /// # use proc_macro2::{self as syn, Span};
281 /// # let ident = syn::Ident::new("i", Span::call_site());
295 /// # use proc_macro2::{Ident, Span};
298 /// # let ident = Ident::new("i", Span::call_site());
312 /// # use proc_macro2::{self as syn, Span};
315 /// # let ident = syn::Ident::new("i", Span::call_site());
[all …]
H A Dspanned.rs5 use proc_macro2::{Span, TokenStream};
9 fn __span(&self) -> Span; in __span() argument
12 impl Spanned for Span { implementation
13 fn __span(&self) -> Span { in __span() argument
19 fn __span(&self) -> Span { in __span() argument
25 fn __span(&self) -> Span { in __span() argument
30 fn join_spans(tokens: TokenStream) -> Span { in join_spans() argument
31 let mut iter = tokens.into_iter().map(|tt| tt.span()); in join_spans()
34 Some(span) => span, in join_spans()
35 None => return Span::call_site(), in join_spans()
[all …]
H A Dident_fragment.rs5 use proc_macro2::{Ident, Span};
19 /// Span associated with this `IdentFragment`.
22 fn span(&self) -> Option<Span> { in span() argument
28 fn span(&self) -> Option<Span> { in span() argument
29 <T as IdentFragment>::span(*self) in span()
38 fn span(&self) -> Option<Span> { in span() argument
39 <T as IdentFragment>::span(*self) in span()
48 fn span(&self) -> Option<Span> { in span() argument
49 Some(self.span()) in span()
66 fn span(&self) -> Option<Span> { in span() argument
[all …]
/linux/rust/proc-macro2/probe/
H A Dproc_macro_span.rs3 // This code exercises the surface area that we expect of Span's unstable API.
12 use proc_macro::{Literal, Span};
15 pub fn byte_range(this: &Span) -> Range<usize> { in byte_range()
19 pub fn start(this: &Span) -> Span { in start() argument
23 pub fn end(this: &Span) -> Span { in end() argument
27 pub fn line(this: &Span) -> usize { in line()
31 pub fn column(this: &Span) -> usize { in column()
35 pub fn file(this: &Span) -> String { in file()
39 pub fn local_file(this: &Span) -> Option<PathBuf> { in local_file()
43 pub fn join(this: &Span, other: Span) -> Option<Span> { in join() argument
[all …]
H A Dproc_macro_span_location.rs3 // The subset of Span's API stabilized in Rust 1.88.
7 use proc_macro::Span;
9 pub fn start(this: &Span) -> Span { in start() argument
13 pub fn end(this: &Span) -> Span { in end() argument
17 pub fn line(this: &Span) -> usize { in line()
21 pub fn column(this: &Span) -> usize { in column()
/linux/drivers/net/ethernet/mellanox/mlxsw/
H A Dspectrum_span.c46 struct mlxsw_sp_span *span; member
77 return atomic_read(&mlxsw_sp->span->active_entries_count); in mlxsw_sp_span_occ_get()
83 struct mlxsw_sp_span *span; in mlxsw_sp_span_init() local
90 span = kzalloc(struct_size(span, entries, entries_count), GFP_KERNEL); in mlxsw_sp_span_init()
91 if (!span) in mlxsw_sp_span_init()
93 refcount_set(&span->policer_id_base_ref_count, 0); in mlxsw_sp_span_init()
94 span->entries_count = entries_count; in mlxsw_sp_span_init()
95 atomic_set(&span->active_entries_count, 0); in mlxsw_sp_span_init()
96 mutex_init(&span->analyzed_ports_lock); in mlxsw_sp_span_init()
97 INIT_LIST_HEAD(&span->analyzed_ports_list); in mlxsw_sp_span_init()
[all …]
/linux/drivers/net/ethernet/marvell/prestera/
H A Dprestera_span.c37 list_add_tail(&entry->list, &port->sw->span->entries); in prestera_span_entry_create()
49 prestera_span_entry_find_by_id(struct prestera_span *span, u8 span_id) in prestera_span_entry_find_by_id() argument
53 list_for_each_entry(entry, &span->entries, list) { in prestera_span_entry_find_by_id()
62 prestera_span_entry_find_by_port(struct prestera_span *span, in prestera_span_entry_find_by_port() argument
67 list_for_each_entry(entry, &span->entries, list) { in prestera_span_entry_find_by_port()
82 entry = prestera_span_entry_find_by_port(sw->span, port); in prestera_span_get()
108 entry = prestera_span_entry_find_by_id(sw->span, span_id); in prestera_span_put()
171 struct prestera_span *span; in prestera_span_init() local
173 span = kzalloc(sizeof(*span), GFP_KERNEL); in prestera_span_init()
174 if (!span) in prestera_span_init()
[all …]
/linux/drivers/scsi/megaraid/
H A Dmegaraid_sas_fp.c123 u16 MR_LdSpanArrayGet(u32 ld, u32 span, struct MR_DRV_RAID_MAP_ALL *map) in MR_LdSpanArrayGet() argument
125 return le16_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span].span.arrayRef); in MR_LdSpanArrayGet()
148 static struct MR_LD_SPAN *MR_LdSpanPtrGet(u32 ld, u32 span, in MR_LdSpanPtrGet() argument
151 return &map->raidMap.ldSpanMap[ld].spanBlock[span].span; in MR_LdSpanPtrGet()
338 dev_err(&instance->pdev->dev, "megasas: span map %x, pDrvRaidMap->totalSize : %x\n", in MR_ValidateMapInfo()
379 u32 span, j; in MR_GetSpanBlock() local
381 for (span = 0; span < raid->spanDepth; span++, pSpanBlock++) { in MR_GetSpanBlock()
398 return span; in MR_GetSpanBlock()
408 * This routine calculates the Span block for given row using spanset.
418 * span - Span number
[all …]
/linux/drivers/iio/dac/
H A Dltc2664.c92 /* span code of the channel */
93 u8 span; member
136 int span, fs; in ltc2664_scale_get() local
138 span = chan->span; in ltc2664_scale_get()
139 if (span < 0) in ltc2664_scale_get()
140 return span; in ltc2664_scale_get()
142 fs = span_helper[span][1] - span_helper[span][0]; in ltc2664_scale_get()
150 int span, fs; in ltc2672_scale_get() local
152 span = chan->span - 1; in ltc2672_scale_get()
153 if (span < 0) in ltc2672_scale_get()
[all …]
/linux/drivers/platform/surface/aggregator/
H A Dssh_parser.c18 * @src: The span of data over which the CRC should be computed.
21 * Computes the CRC of the provided data span (@src), compares it to the CRC
39 * @src: The data span to check the start of.
47 * sshp_find_syn() - Find SSH SYN bytes in the given data span.
48 * @src: The data span to search in.
49 * @rem: The span (output) indicating the remaining data, starting with SSH
52 * Search for SSH SYN bytes in the given source span. If found, set the @rem
53 * span to the remaining data, starting with the first SYN bytes and capped by
54 * the source span length, and return %true. This function does not copy any
58 * If no SSH SYN bytes could be found, set the @rem span to the zero-length
[all …]
/linux/fs/netfs/
H A Diterator.c106 * Select the span of a bvec iterator we're going to use. Limit it by both maximum
107 * size and maximum number of segments. Returns the size of the span in bytes.
114 size_t len, span = 0, n = iter->count; in netfs_limit_bvec() local
133 span += len; in netfs_limit_bvec()
136 if (span >= max_size || nsegs >= max_segs) in netfs_limit_bvec()
142 return min(span, max_size); in netfs_limit_bvec()
146 * Select the span of an xarray iterator we're going to use. Limit it by both
149 * Returns the size of the span in bytes.
158 size_t span = 0, n = iter->count; in netfs_limit_xarray() local
181 span += len; in netfs_limit_xarray()
[all …]

12345678910>>...14