aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2024-12-31lang-item: Add Option::{None, Some}, Iterator::next, IntoIter::into_iterArthur Cohen2-0/+15
gcc/rust/ChangeLog: * util/rust-lang-item.h: Add new lang items. * util/rust-lang-item.cc: Likewise.
2024-12-31lang-item: Add Sync traitArthur Cohen2-0/+2
gcc/rust/ChangeLog: * util/rust-lang-item.h: Add Sync marker trait. * util/rust-lang-item.cc: Likewise.
2024-12-31typecheck: Add note about erorring out on additional trait bounds.Arthur Cohen1-0/+5
If additional trait bounds aren't auto traits, then the typechecker must error out (Rust-GCC#3008) gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-type.cc: Add TODO note.
2024-12-31resolve: Name resolve trait bounds properlyArthur Cohen6-4/+87
gcc/rust/ChangeLog: * resolve/rust-ast-resolve-type.cc (ResolveTypeToCanonicalPath::visit): Resolve additional trait bounds. * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Error out properly on unresolved type-path instead of crashing. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Exclude additional-trait-bounds2 for different error message. * rust/compile/additional-trait-bounds1.rs: New test. * rust/compile/additional-trait-bounds2.rs: New test. * rust/compile/additional-trait-bounds2nr2.rs: New test.
2024-12-31parser: Add testcases for multiline stringsArthur Cohen2-0/+29
Regression checks for Rust-GCC#1399 gcc/testsuite/ChangeLog: * rust/compile/multiline-string.rs: New test. * rust/execute/torture/multiline-string.rs: New test.
2024-12-24typecheck-path: Fix typo (reciever -> receiver)Arthur Cohen3-8/+8
gcc/rust/ChangeLog: * typecheck/rust-hir-path-probe.cc: Fix typos. * typecheck/rust-hir-path-probe.h: Likewise. * typecheck/rust-hir-type-check-path.cc: Likewise.
2024-12-23add ptr to int and int to ptr type cast rulesNobel2-2/+43
Added rules to allow type casting pointer as integer types (u*,i*) and integer types to be casted as pointer. gcc/rust/ChangeLog: * typecheck/rust-casts.cc (TypeCastRules::cast_rules): Add rule. gcc/testsuite/ChangeLog: * rust/compile/ptr_int_cast.rs: New test. Signed-off-by: Nobel Singh <nobel2073@gmail.com>
2024-12-19gccrs: Made changes to AST::TraitImpl constructor for TypePathSri Ganesh Thota1-7/+6
gcc/rust/ChangeLog: * ast/rust-item.h: I have changed helper constructor for typepath to be a delegating constructor. Signed-off-by: Sri Ganesh Thota <sriganeshthota12345@gmail.com>
2024-12-13gccrs: implement the TuplePattern and use it for function patternsPhilip Herron5-14/+117
In order to handle the tuple pattern of: fn test ((x _) : (i32, i32)) -> i32 { x } we need to recognize that ABI wise this function still takes a tuple as the parameter to this function its just how we can address the "pattern" of the tuple changes. So reall if this was C it would look like: void test (struct tuple_type __prameter) { return __parameter.0 } The code here reuses our existing pattern code so that we generate these implicit bindings of the paramter with a field access so any time x is referenced it's really just emplacing __parameter.0 for the field access into the struct which is a tuple. Fixes Rust-GCC#2847 gcc/rust/ChangeLog: * backend/rust-compile-fnparam.cc (CompileFnParam::visit): compile tuple patterns (CompileSelfParam::compile): update return type (CompileFnParam::create_tmp_param_var): return Bvariable not tree to stop ICE * backend/rust-compile-fnparam.h: update prototype * backend/rust-compile-pattern.cc (CompilePatternBindings::visit): implement TuplePattern * backend/rust-compile-pattern.h: update prototype gcc/testsuite/ChangeLog: * rust/compile/issue-2847.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-12-13gccrs: fix bad not expression in rustPhilip Herron1-1/+1
Fixes Rust-GCC#3229 gcc/rust/ChangeLog: * rust-gcc.cc (operator_to_tree_code): ! expressions are BIT_NOT_EXPR Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-12-10build: update bootstrap req to C++14Jason Merrill1-14/+13
We moved to a bootstrap requirement of C++11 in GCC 11, 8 years after support was stable in GCC 4.8. It is now 8 years since C++14 was the default mode in GCC 6 (and 9 years since support was complete in GCC 5), and we have a few bits of optional C++14 code in the compiler, so it seems a good time to update the bootstrap requirement again. The big benefit of the change is the greater constexpr power, but C++14 also added variable templates, generic lambdas, lambda init-capture, binary literals, and numeric literal digit separators. C++14 was feature-complete in GCC 5, and became the default in GCC 6. 5.4.0 bootstraps trunk correctly; trunk stage1 built with 5.3.0 breaks in eh_data_format_name due to PR69995. gcc/ChangeLog: * doc/install.texi (Prerequisites): Update to C++14. ChangeLog: * configure.ac: Update requirement to C++14. * configure: Regenerate.
2024-12-09lang-item: Remove unused NodeId from LangItemPathArthur Cohen1-39/+37
gcc/rust/ChangeLog: * ast/rust-path.h: Adapt children of Path to fix some NodeId issues.
2024-12-09nr2.0: Resolve lang item paths properly.Arthur Cohen2-0/+21
gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): New. * resolve/rust-late-name-resolver-2.0.h: New.
2024-12-09hir: Lower lang-item pathsArthur Cohen3-14/+43
gcc/rust/ChangeLog: * hir/rust-ast-lower-type.cc (ASTLowerTypePath::translate): Adapt to handle lang item paths. (ASTLowerTypePath::visit): Likewise. (ASTLowerTypePath::translate_type_path): New. (ASTLowerTypePath::translate_lang_item_type_path): New. * hir/rust-ast-lower-type.h: Adapt to handle lang item paths. * resolve/rust-ast-resolve-type.h: Likewise.
2024-12-09nr1.0: Resolve lang item paths properly.Arthur Cohen2-9/+32
gcc/rust/ChangeLog: * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Adapt resolver to lang item paths. * resolve/rust-ast-resolve-type.h: Likewise.
2024-12-09hir: Start adapting visitors to accept multiple kinds of PathsArthur Cohen6-3/+47
gcc/rust/ChangeLog: * ast/rust-item.h: Add new method to specifically get a type-path. * ast/rust-path.cc (LangItemPath::as_string): Implement properly. * hir/rust-ast-lower-type.cc (ASTLowerTypePath::translate): Adapt visitor to use the new LangItemPath. * hir/rust-ast-lower-type.h: Likewise. * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise. * resolve/rust-ast-resolve-type.h: Likewise.
2024-12-09derive(Copy): Use new LangItemPathArthur Cohen1-2/+4
gcc/rust/ChangeLog: * expand/rust-derive-copy.cc: Use new LangItemPath for derive(Copy).
2024-12-09ast: Add LangItemPath classArthur Cohen3-34/+71
This commit adds a new kind of Path, changes the base Path class and turns TypePath into a child of the base Path class. gcc/rust/ChangeLog: * ast/rust-path.h (class LangItemPath): New. (class TypePath): Adapt to accomodate LangItemPath. * ast/rust-ast.cc (TraitImpl::as_string): Use new checks for lang items. (QualifiedPathType::as_string): Likewise. (FormatArgs::set_outer_attrs): Likewise. * ast/rust-item.h (class TraitImpl): Likewise.
2024-12-09Fix ForeverStack::find_starting_point output parameterOwen Avery2-7/+9
gcc/rust/ChangeLog: * resolve/rust-forever-stack.h (ForeverStack::find_starting_point): Use type 'std::reference_wrapper<Node> &' instead of 'Node &' for parameter starting_point. * resolve/rust-forever-stack.hxx (ForeverStack::find_starting_point): Likewise. (ForeverStack::resolve_path): Handle change to ForeverStack::find_starting_point. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2024-12-05type-check: Remove unused capture in nr2.0Arthur Cohen1-3/+3
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Remove unused capture in lambda.
2024-12-04attributes: Add class for sharing methods on attributes.Arthur Cohen4-20/+18
gcc/rust/ChangeLog: * util/rust-attributes.h (class Attributes): New. * util/rust-attributes.cc: Implement Attributes::is_known(). * ast/rust-collect-lang-items.cc (is_known_attribute): Remove. (get_lang_item_attr): Call Attributes::is_known() instead. * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Likewise. (ASTLoweringBase::is_known_attribute): Remove.
2024-12-04lang-items: Add lang-items AST collectorArthur Cohen4-1/+160
gcc/rust/ChangeLog: * Make-lang.in: Add new object file. * rust-session-manager.cc (Session::compile_crate): Call CollectLangItems. * ast/rust-collect-lang-items.cc: New file. * ast/rust-collect-lang-items.h: New file.
2024-12-04lang-items: Store NodeId mappings for lang itemsArthur Cohen2-0/+30
gcc/rust/ChangeLog: * util/rust-hir-map.h: Keep a NodeId mappings for lang items. * util/rust-hir-map.cc (Mappings::insert_lang_item_node): New function. (Mappings::lookup_lang_item_node): Likewise.
2024-12-02gccrs: fix crash in hir dumpPhilip Herron1-1/+2
gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::visit): add missing check for no return value Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-12-02gccrs: add test case to show issue is fixedPhilip Herron2-0/+4
Fixes Rust-GCC#266 gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-266.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-12-02gccrs: add checks for division by zero and left shift overflowPhilip Herron3-3/+30
These are ported from the c-family code c-warn.cc and c/c-typchk.cc Fixes Rust-GCC#2394 gcc/rust/ChangeLog: * backend/rust-constexpr.cc (eval_store_expression): check for null (eval_call_expression): remove bad warning * rust-gcc.cc (arithmetic_or_logical_expression): add warnings gcc/testsuite/ChangeLog: * rust/compile/issue-2394.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-12-02gccrs: constant evaluation like these are coercion sitesPhilip Herron5-15/+50
The code here was wrongly assuming the decl type from the folding of the expression would be the type of the constant decl. This is not the case for unsized coercions for slices, where the expression here is a reference to an array then we require the coercion to fix the result up to the expected type. Fixes Rust-GCC#1525 gcc/rust/ChangeLog: * backend/rust-compile-base.cc: apply coercion site to result * backend/rust-compile-base.h: update prototype * backend/rust-compile-implitem.cc (CompileTraitItem::visit): send in coercion info * backend/rust-compile-item.cc (CompileItem::visit): likewise gcc/testsuite/ChangeLog: * rust/compile/issue-1525.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-12-02gccrs: Remove bad assertion in name resolutionPhilip Herron3-6/+39
This was a handy debug assertion but only works for valid rust code. This needs to handle the case where the type is not resolved which is a valid case. Fixes Rust-GCC#2423 gcc/rust/ChangeLog: * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): remove assertions gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 can't handle this * rust/compile/issue-2423.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-12-02ast: Use StackedContexts class in ContextualASTVisitorArthur Cohen3-26/+20
gcc/rust/ChangeLog: * ast/rust-ast-visitor.h: Replace context with StackedContexts. * ast/rust-ast-visitor.cc (ContextualASTVisitor::visit): Use new APIs. * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Likewise.
2024-12-02stacked-contexts: Add peek() methodArthur Cohen1-0/+7
gcc/rust/ChangeLog: * util/rust-stacked-contexts.h: Add new method to see what context we are currently in.
2024-11-30hir: Remove duplicate function in TraitItemFuncArthur Cohen6-7/+5
Both TraitItemFunc::has_definition() and TraitItemFunc::has_block_defined() were exactly the same implementation, so remove one. gcc/rust/ChangeLog: * hir/tree/rust-hir-item.h: Remove TraitItemFunc::has_block_defined() * backend/rust-compile-implitem.cc (CompileTraitItem::visit): Call TraitItemFunc::has_definition() instead. * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise. * checks/errors/rust-hir-pattern-analysis.cc (PatternChecker::visit): Likewise. * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise. * typecheck/rust-hir-trait-resolve.cc (ResolveTraitItemToRef::visit): Likewise.
2024-11-28mappings: Move lang_item definitions to .ccArthur Cohen2-16/+21
gcc/rust/ChangeLog: * util/rust-hir-map.h: Move definitions from header... * util/rust-hir-map.cc: ...to source file.
2024-11-28lang-items: Move comment about arithmetic lang itemsArthur Cohen1-1/+1
gcc/rust/ChangeLog: * util/rust-lang-item.h: Fix comment location to align with other comments.
2024-11-27gccrs: ensure packed and aligned is applied properlyPhilip Herron3-12/+17
We cannot apply aligned or packed after layout_type is called you need to set this up first then call it. Fixes Rust-GCC#3260 gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): call lauout type directly * rust-backend.h (struct_type): add optional layout parameter (union_type): likewise (fill_in_fields): likewise * rust-gcc.cc (struct_type): likewise (union_type): likewise (fill_in_fields): only layout if we required Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-11-27gccrs: allow casts from numeric types to floatsPhilip Herron2-0/+28
Fixes Rust-GCC#3261 gcc/rust/ChangeLog: * typecheck/rust-casts.cc (TypeCastRules::cast_rules): allow casts to float gcc/testsuite/ChangeLog: * rust/compile/issue-3261.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-11-27gccrs: improve handling of Self Type pathsPhilip Herron9-61/+287
TypePaths have special handling for Self where we can look at the current ctx for more acurate TypeAlias information if required. We cant do this for Impl contexts but not for Traits as we might as well fall back to the TypePathProbe. The other issue was the dyn type comming in because Foo::foo and Foo is a trait reference we represent this as a dyn type as the root resolved path but then find the associated impl block for this but we cannot do this when we have resolved to a Dyn because this is just a representation that we know we are talking about a trait not because we are actually working with a real Dyn type. Fixes Rust-GCC#2907 gcc/rust/ChangeLog: * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): track trait * typecheck/rust-hir-type-check-implitem.cc: trait block * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): dont when dyn * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): look at Self contenxt (TypeCheckType::resolve_root_path): track if Self (TypeCheckType::resolve_associated_type): look at current context for associated types * typecheck/rust-hir-type-check-type.h: change prototype * typecheck/rust-hir-type-check.h (class TypeCheckBlockContextItem): new context system to track current state * typecheck/rust-typecheck-context.cc (TypeCheckContext::have_block_context): likewise (TypeCheckContext::peek_block_context): likewise (TypeCheckContext::push_block_context): likewise (TypeCheckContext::pop_block_context): likewise (TypeCheckBlockContextItem::Item::Item): likewise (TypeCheckBlockContextItem::TypeCheckBlockContextItem): likewise (TypeCheckBlockContextItem::is_impl_block): likewise (TypeCheckBlockContextItem::is_trait_block): likewise (TypeCheckBlockContextItem::get_impl_block): likewise (TypeCheckBlockContextItem::get_trait): likewise gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-2907.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-11-27gccrs: fix crash in hir dump with missing guardsPhilip Herron1-4/+8
gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::visit): add missing null checks Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-11-27Prepend crate name to functions with nr2Pierre-Emmanuel Patry2-7/+10
gcc/rust/ChangeLog: * backend/rust-compile-base.cc: Prepend crate name to function's ir name. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove passing tests from exclude list. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-11-22Prevent execution of some nr1.0 functions with nr2.0Owen Avery1-0/+13
gcc/rust/ChangeLog: * resolve/rust-name-resolver.cc: Include options.txt. (Resolver::insert_resolved_name): Assert that name resolution 2.0 is disabled. (Resolver::lookup_resolved_name): Likewise. (Resolver::insert_resolved_type): Likewise. (Resolver::lookup_resolved_type): Likewise. (Resolver::insert_resolved_label): Likewise. (Resolver::lookup_resolved_label): Likewise. (Resolver::insert_resolved_macro): Likewise. (Resolver::lookup_resolved_macro): Likewise. (Resolver::insert_resolved_misc): Likewise. (Resolver::lookup_resolved_misc): Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2024-11-22gccrs: empty match expressions should resolve to !Philip Herron8-14/+58
This is a special case in Rust and the ! type can unify with pretty much anything its almost a inference variable and a unit-type for special cases. Fixes Rust-GCC/gccrs#3231 Fixes Rust-GCC/gccrs#2567 gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (check_match_scrutinee): check for empty match (CompileExpr::visit): fix assertion * checks/errors/rust-hir-pattern-analysis.cc (check_match_usefulness): check for empty * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): resolve to ! gcc/testsuite/ChangeLog: * rust/compile/exhaustiveness1.rs: remove bad check * rust/compile/issue-2567-1.rs: New test. * rust/compile/issue-2567-2.rs: New test. * rust/compile/issue-2567-3.rs: New test. * rust/compile/issue-3231.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-11-22gccrs: fix crashes in hir dump since move to referencesPhilip Herron1-4/+8
gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::visit): add guards Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-11-22Clean up some system includesPierre-Emmanuel Patry11-13/+6
System includes shall use rust-system header instead. gcc/rust/ChangeLog: * ast/rust-stmt.h: Remove stdlib include and use rust-system instead. * backend/rust-compile-expr.cc: Likewise. * backend/rust-mangle-legacy.cc: Likewise. * backend/rust-mangle-v0.cc: Likewise. * hir/rust-hir-dump.cc: Likewise. * typecheck/rust-hir-type-check-type.cc: Likewise. * typecheck/rust-tyty.cc: Likewise. * typecheck/rust-tyty.h: Likewise. * util/rust-common.h: Likewise. * util/rust-token-converter.cc: Likewise. * util/rust-token-converter.h: Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-11-21Use nr2.0 in typecheckerOwen Avery4-43/+155
I probably missed a few spots, but this should cover most of the type checker. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc: Add includes. (TypeCheckExpr::visit): Use name resolver 2.0. (TypeCheckExpr::resolve_operator_overload): Likewise. (TypeCheckExpr::resolve_fn_trait_call): Likewise. * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): Likewise. (TypeCheckExpr::resolve_segments): Likewise. * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_segments): Likewise. (ResolveWhereClauseItem::visit): Likewise. (TypeCheckType::visit): Avoid usage of Resolver::get_unit_type_node_id when handling TupleType, use name resolver 2.0 when handling QualifiedPathInType. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove entries. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2024-11-20Handle type path segments during late resolution 2.0Owen Avery2-2/+2
gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Call DefaultResolver::visit when visiting TypePath. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove entries. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2024-11-20Use nr2.0 in PrivacyReporterOwen Avery2-3/+9
gcc/rust/ChangeLog: * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_for_privacy_violation): Use name resolver 2.0. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove entries. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2024-11-20Use a reference wrapper to please GCC 4.8Pierre-Emmanuel Patry2-10/+11
gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Change call. (CompileExpr::resolve_operator_overload): Update function arguments. * backend/rust-compile-expr.h: Change the function's prototype to use a reference wrapper instead of a reference within the optional. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-11-20Use default constructor for default argumentsPierre-Emmanuel Patry1-3/+3
GCC 4.8 complains about the initializer list. gcc/rust/ChangeLog: * typecheck/rust-tyty.h: Change initializer list to default constructor call. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-11-20Add optional template arguments to please GCC4.8Pierre-Emmanuel Patry3-6/+11
Clang on macos as well as GCC 4.8 complains when those templates are missing. gcc/rust/ChangeLog: * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Add template to tl::optional. * hir/rust-ast-lower-type.cc (ASTLowerGenericParam::visit): Likewise. * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::visit): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-11-20Fix FnParam pattern location ternary logicPierre-Emmanuel Patry1-6/+4
Condition was inverted, we should retrieve the locus only if we have a pattern. gcc/rust/ChangeLog: * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Do not get a reference if the pattern does not exist. (TypeCheckMethodCallExpr::check): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-11-20Refactor optional initializersPierre-Emmanuel Patry1-9/+11
Refactor some optional initializer in the lowering stage to make them more readable. gcc/rust/ChangeLog: * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Change the ternary expression with a more readable if. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>