Revert optional lang item segment name.
Restores mandatory language item segment names to ensure accurate AST dumping in gccrs.
This commit reverts changes that made language item segment names optional in gccrs. It was found that these names are not fixed and are declared within the core crate. Making them optional prevented accurate dumping of the Abstract Syntax Tree (AST), as the exact paths to language items could not be reconstructed. The segment name argument has been added back to relevant AST builder functions.
In Details
Language item segment names in gccrs, previously made optional, are now mandatory again. This decision stems from the realization that these names are dynamically declared within the core crate and are essential for accurately reconstructing the AST, particularly for type paths. The change updates several AST builder functions and related headers to enforce this.
- AST
- Abstract Syntax Tree. A tree representation of the abstract syntactic structure of source code, used internally by compilers.
- lang item
- Language item. Special, built-in items in Rust (like String, Option, Vec) that are fundamental to the language's operation and are often handled specially by the compiler.
- type path
- A path that specifies a type, similar to a file path, allowing navigation through modules and namespaces to identify a specific type.