rust/syn/expr.rs
Source file repositories/reference/linux-study-clean/rust/syn/expr.rs
File Facts
- System
- Linux kernel
- Corpus path
rust/syn/expr.rs- Extension
.rs- Size
- 141825 bytes
- Lines
- 4176
- Domain
- Rust Kernel Layer
- Bucket
- Rust API Membrane
- Inferred role
- Rust Kernel Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
- Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function parse_with_earlier_boundary_rulefunction eqfunction continue_parsing_earlyfunction continue_parsing_earlyfunction Okfunction Okfunction Somefunction Okfunction Okfunction Okfunction rest_of_path_or_macro_or_structfunction Somefunction expr_breakfunction Okfunction letfunction Okfunction letfunction Okfunction Okfunction Okfunction Okfunction pubfunction inner_attrs_to_tokensfunction pubfunction pubfunction to_tokensfunction to_tokensfunction print_expr_assignfunction to_tokensfunction to_tokensfunction print_expr_awaitfunction to_tokensfunction print_expr_binaryfunction to_tokensfunction to_tokensfunction print_expr_breakfunction to_tokensfunction print_expr_callfunction to_tokensfunction print_expr_castfunction to_tokensfunction print_expr_closurefunction to_tokensfunction to_tokensfunction to_tokensfunction print_expr_fieldfunction to_tokensfunction to_tokens
Annotated Snippet
match (self, other) {
(Member::Named(this), Member::Named(other)) => this == other,
(Member::Unnamed(this), Member::Unnamed(other)) => this == other,
_ => false,
}
}
}
impl Hash for Member {
fn hash<H: Hasher>(&self, state: &mut H) {
match self {
Member::Named(m) => m.hash(state),
Member::Unnamed(m) => m.hash(state),
}
}
}
#[cfg(feature = "printing")]
impl IdentFragment for Member {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
match self {
Member::Named(m) => Display::fmt(m, formatter),
Member::Unnamed(m) => Display::fmt(&m.index, formatter),
}
}
fn span(&self) -> Option<Span> {
match self {
Member::Named(m) => Some(m.span()),
Member::Unnamed(m) => Some(m.span),
}
}
}
#[cfg(any(feature = "parsing", feature = "printing"))]
impl Member {
pub(crate) fn is_named(&self) -> bool {
match self {
Member::Named(_) => true,
Member::Unnamed(_) => false,
}
}
}
ast_struct! {
/// The index of an unnamed tuple struct field.
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
pub struct Index {
pub index: u32,
pub span: Span,
}
}
impl From<usize> for Index {
fn from(index: usize) -> Index {
assert!(index < u32::MAX as usize);
Index {
index: index as u32,
span: Span::call_site(),
}
}
}
impl Eq for Index {}
impl PartialEq for Index {
fn eq(&self, other: &Self) -> bool {
self.index == other.index
}
}
impl Hash for Index {
fn hash<H: Hasher>(&self, state: &mut H) {
self.index.hash(state);
}
}
#[cfg(feature = "printing")]
impl IdentFragment for Index {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Display::fmt(&self.index, formatter)
}
fn span(&self) -> Option<Span> {
Some(self.span)
}
}
ast_struct! {
/// A field-value pair in a struct literal.
Annotation
- Detected declarations: `function parse_with_earlier_boundary_rule`, `function eq`, `function continue_parsing_early`, `function continue_parsing_early`, `function Ok`, `function Ok`, `function Some`, `function Ok`, `function Ok`, `function Ok`.
- Atlas domain: Rust Kernel Layer / Rust API Membrane.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.