Skip to main content

Module rust

Module rust 

Source
Expand description

The Rust frontend: reads a Rust program into the surface AST.

It reads the subset of Rust the core can represent faithfully: modules with use of crate items, enums with unit and tuple variants (Box<T> fields are the recursive occurrences of a value type), free functions over machine integers, bool and String, anonymous scalar Copy tuple products, expression bodies with let, if, match and format!, and a main made of println!, let and assert!/assert_eq! statements. Everything else is rejected with a precise obligation.

Mirrors js/src/translation/rust.js.

Functionsยง

parse_rust
Reads a Rust program.
parse_rust_with_array_result_model
Read Rust under an explicit versioned scalar vector result admission model.
parse_rust_with_completion_model
Read closed guarded returns under an explicitly selected source profile.
parse_rust_with_const_function_model
Read owned const qualification on closed primitive Rust predicates.
parse_rust_with_empty_option_source_model
Read the explicit closed empty primitive option source interpretation.
parse_rust_with_owned_local_state_model
Read explicit owned String local state and its exact source interface.
parse_rust_with_primitive_owner_model
Read the explicitly selected standard binary64 source owner interpretation.
parse_rust_with_pure_unit_call_model
Read complete closed pure Unit programs under the independently selected model.
parse_rust_with_runtime_shell_model
Read a complete emitted Rust runtime under its independent owned interpretation.
parse_rust_with_scalar_loop_model
Read an explicitly selected closed primitive scalar loop interpretation.
parse_rust_with_source_models
Read Rust with independently selected array-result and completion profiles.
parse_rust_with_source_profiles
Read independently selected array, completion and source signature models.
parse_rust_with_source_signature_model
Capture actual structured source header facts under an explicit model.
parse_rust_with_type_namespace_model
Read Rust with actual source type-namespace ownership and ordered spellings.