2025-08-08  Release Manager

	* GCC 15.2.0 released.

2025-07-18  Martin Jambor  <mjambor@suse.cz>

	Backported from master:
	2025-06-26  Martin Jambor  <mjambor@suse.cz>

	* checks/errors/borrowck/rust-borrow-checker-diagnostics.cc
	(BorrowCheckerDiagnostics::get_loan): Type cast loan to uint32_t.

2025-07-18  Owen Avery  <powerboat9.gamer@gmail.com>

	Backported from master:
	2025-04-28  Owen Avery  <powerboat9.gamer@gmail.com>

	* checks/errors/borrowck/rust-bir-place.h
	(IndexVec::size_type): Add.
	(IndexVec::MAX_INDEX): Add.
	(IndexVec::size): Change the return type to the type of the
	internal value used by the index type.
	(PlaceDB::lookup_or_add_variable): Use the return value from the
	PlaceDB::add_place call.
	* checks/errors/borrowck/rust-bir.h
	(struct BasicBlockId): Move this definition before the
	definition of the struct Function.

2025-07-08  Arthur Cohen  <arthur.cohen@embecosm.com>

	* resolve/rust-late-name-resolver-2.0.cc (Late::Late): False initialize the
	funny_error field.

2025-04-25  Release Manager

	* GCC 15.1.0 released.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* util/rust-lang-item.h: Add new manually_drop lang item.
	* util/rust-lang-item.cc: Likewise.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* util/rust-attribute-values.h: Add RUSTFMT value.
	* util/rust-attributes.cc: Define the attribute.
	* util/rust-attributes.h (enum CompilerPass): Add EXTERNAL variant.
	* expand/rust-macro-builtins.cc: Fix formatting.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes): Remove assertion.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* util/rust-attribute-values.h: Add missing attributes.
	* util/rust-attributes.cc: Likewise.
	* util/rust-attributes.h (enum CompilerPass): Mention adding something for const
	functions.

2025-04-14  beamandala  <mandalapubhavesh@gmail.com>

	* expand/rust-macro-builtins.cc (MacroBuiltin::builtin_transcribers):
	Add entry for track_caller.
	* util/rust-attribute-values.h: add `TRACK_CALLER` attribute.
	* util/rust-attributes.cc: add `track_caller` attribute definition.

2025-04-14  Owen Avery  <powerboat9.gamer@gmail.com>

	* checks/errors/rust-const-checker.cc
	(ConstChecker::visit): Visit the enum items of enums.
	* resolve/rust-ast-resolve-item.cc
	(ResolveItem::visit): Resolve enum discriminants during nr1.0.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* expand/rust-macro-builtins-format-args.cc (format_args_parse_arguments): Improve safety,
	allow extra commas after end of argument list.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Call into
	TokenTreeDesugar.
	* expand/rust-token-tree-desugar.cc: New file.
	* expand/rust-token-tree-desugar.h: New file.
	* Make-lang.in: Compile them.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* expand/rust-macro-expand.cc (MacroExpander::match_n_matches): Do not
	insert fragments and substack fragments if the matcher failed.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* rust-session-manager.cc (Session::compile_crate): Call the visitor later in the pipeline.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* ast/rust-ast.h (DelimTokenTree::get_locus): New function.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* ast/rust-expr.h (class RangeExpr): Add empty outer attributes and allow getting them
	and setting them.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Return if module
	is unloaded.

2025-04-14  Arthur Cohen  <arthur.cohen@embecosm.com>

	* typecheck/rust-hir-type-check-expr.cc (is_default_fn): New.
	(emit_ambiguous_resolution_error): New.
	(handle_multiple_candidates): Properly handle multiple candidates in
	the case of specialization.
	(TypeCheckExpr::visit): Call `handle_multiple_candidates`.

2025-04-14  Andrew Pinski  <quic_apinski@quicinc.com>

	PR rust/119342
	* rust-gcc.cc (block): Add comment on why chaining
	the variables of the scope toether.

2025-04-14  Andrew Pinski  <quic_apinski@quicinc.com>

	PR rust/119341
	* rust-gcc.cc (function_type): Use range fors.
	(function_type_variadic): Likewise.
	(fill_in_fields): Likewise.
	(statement_list): Likewise.
	(block): Likewise.
	(block_add_statements): Likewise.
	(function_set_parameters): Likewise.
	(write_global_definitions): Likewise.

2025-04-14  Andrew Pinski  <quic_apinski@quicinc.com>

	* rust-gcc.cc (Bvariable::get_tree): Use error_operand_p.
	(pointer_type): Likewise.
	(reference_type): Likewise.
	(immutable_type): Likewise.
	(function_type): Likewise.
	(function_type_variadic): Likewise.
	Cleanup the check for receiver.type first.
	(function_ptr_type): Use error_operand_p.
	(fill_in_fields): Likewise.
	(fill_in_array): Likewise.
	(named_type): Likewise.
	(type_size): Likewise.
	(type_alignment): Likewise.
	(type_field_alignment): Likewise.
	(type_field_offset): Likewise.
	(zero_expression): Likewise.
	(float_constant_expression): Likewise.
	(convert_expression): Likewise.
	(struct_field_expression): Likewise.
	(compound_expression): Likewise.
	(conditional_expression): Likewise.
	(negation_expression): Likewise.
	(arithmetic_or_logical_expression): Likewise.
	(arithmetic_or_logical_expression_checked): Likewise.
	(comparison_expression): Likewise.
	(lazy_boolean_expression): Likewise.
	(constructor_expression): Likewise.
	(array_constructor_expression): Likewise.
	(array_index_expression): Likewise.
	(call_expression): Likewise.
	(init_statement): Likewise.
	(assignment_statement): Likewise.
	(return_statement): Likewise.
	(exception_handler_statement): Likewise.
	(if_statement): Likewise.
	(compound_statement): Likewise.
	Tighten up the code, removing t variable.
	(statement_list): Use error_operand_p.
	(block): Likewise.
	(block_add_statements): Likewise.
	(convert_tree): Likewise.
	(global_variable): Likewise.
	(global_variable_set_init): Likewise.
	(local_variable): Likewise.
	(parameter_variable): Likewise.
	(static_chain_variable): Likewise.
	(temporary_variable): Likewise.
	(function): Likewise. Tighten up the code.
	(function_defer_statement): Use error_operand_p.
	(function_set_parameters): Use error_operand_p.
	(write_global_definitions): Use error_operand_p.
	Tighten up the code around the loop.

2025-04-14  Andrew Pinski  <quic_apinski@quicinc.com>

	* rust-gcc.cc (is_floating_point): Use FLOAT_TYPE_P
	instead of manually checking the type.

2025-04-08  Matty Kuhn  <matty.kuhn.1@gmail.com>

	* ast/rust-ast.h: (AST::Attribute): add empty_input function
	* checks/errors/rust-feature-gate.cc: (FeatureGate::visit): check for empty feature gate

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* ast/rust-ast-collector.cc (TokenCollector::visit): Update label
	getter call.
	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
	* ast/rust-ast.cc (BreakExpr::as_string): Likewise.
	* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
	* resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Likewise.
	* ast/rust-expr.h: Add optional getter and rename label getter to
	get_label_unchecked.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* ast/rust-ast-collector.cc (TokenCollector::visit):
	Call unchecked getter.
	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit):
	Likewise.
	* ast/rust-ast.cc (ContinueExpr::as_string): Likewise.
	* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
	* resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Likewise.
	* ast/rust-expr.h: Add new getter for the optional and rename getter
	to get_label_unchecked.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* parse/rust-parse-impl.h (Parser::parse_loop_label): Change function
	return type to expected.
	(Parser::parse_labelled_loop_expr): Adapt call location to new return
	type.
	* parse/rust-parse.h (enum class): Update function prototype.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add call
	to label resolution if there is one label.
	(Late::resolve_label): Look for labels and emit an error message on
	failure.
	* resolve/rust-late-name-resolver-2.0.h: Add function prototypes.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
	Change error message to match rustc.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* ast/rust-ast-builder.cc (Builder::self_ref_param): Remove error state
	and use optional.
	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Check label
	before visiting.
	* ast/rust-ast.cc (ContinueExpr::as_string): Retrieve label value.
	(Lifetime::as_string): Retrieve lifetime value.
	(ReferenceType::as_string): Likewise.
	(SelfParam::as_string): Likewise.
	* ast/rust-ast.h: Remove lifetime and LifetimeParam error state.
	* ast/rust-desugar-for-loops.cc (DesugarForLoops::DesugarCtx::make_break_arm):
	Use optional instead of error state.
	* ast/rust-expr.h (class ContinueExpr): Make label optional.
	* ast/rust-item.h (class SelfParam): Make lifetime optional.
	* ast/rust-type.h (class ReferenceType): Likewise.
	* backend/rust-compile-base.cc: Use optional for self param instead
	of error state.
	* backend/rust-compile-base.h: Update function prototype.
	* expand/rust-derive-clone.cc (DeriveClone::clone_fn): Use optional.
	* hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): Lower
	lifetime only if it exists.
	* hir/rust-ast-lower-block.h: Lower loop label only if it exists.
	* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
	* hir/rust-ast-lower-implitem.cc (ASTLowerImplItem::visit): Remove
	references to error state.
	(ASTLowerTraitItem::visit): Lower self param only if it exists.
	* hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Use nullopt
	for default value instead of SelfParam error state.
	* hir/rust-ast-lower.cc (ASTLoweringExprWithBlock::visit): Lower label
	only if it exists.
	* hir/rust-hir-dump.cc (Dump::do_traitfunctiondecl): Print self only if
	it exists.
	(Dump::visit): Liewise.
	* hir/tree/rust-hir-bound.h: Remove error state.
	* hir/tree/rust-hir-expr.cc (ContinueExpr::ContinueExpr): Use optional
	in constructor for loop label.
	(BreakExpr::BreakExpr): Likewise.
	* hir/tree/rust-hir-expr.h (class ContinueExpr): Remove error state
	implementation.
	(class BreakExpr): Likewise.
	* hir/tree/rust-hir-generic-param.h: Likewise.
	* hir/tree/rust-hir-item.cc (SelfParam::SelfParam): Make lifetime
	optional.
	(Function::Function): Make self param optional.
	* hir/tree/rust-hir-item.h (class Function): Likewise.
	* hir/tree/rust-hir-type.cc (ReferenceType::ReferenceType): Make
	lifetime optional.
	* hir/tree/rust-hir-type.h (class ReferenceType): Likewise.
	* hir/tree/rust-hir.cc (ContinueExpr::as_string): Use new getter.
	(BreakExpr::as_string): Likewise.
	(Lifetime::as_string): Likewise.
	(ReferenceType::as_string): Likewise.
	(TraitFunctionDecl::as_string): Likewise.
	(SelfParam::as_string): Remove error state checking.
	* parse/rust-parse-impl.h (Parser::parse_generic_param): Adapt to
	optional.
	(Parser::parse_lifetime_params): Likewise.
	(Parser::parse_lifetime_params_objs): Likewise.
	(Parser::parse_lifetime_param): Likewise.
	(Parser::parse_lifetime_where_clause_item): Likewise.
	(Parser::parse_type_param_bound): Likewise.
	(Parser::parse_lifetime_bounds): Likewise.
	(Parser::parse_path_generic_args): Likewise.
	(Parser::parse_self_param): Likewise.
	(Parser::parse_break_expr): Likewise.
	(Parser::parse_continue_expr): Likewise.
	(Parser::parse_reference_type_inner): Likewise.
	* parse/rust-parse.h (class ParseLifetimeParamError): Add new class for
	lifetime param parsing errors.
	(class ParseLifetimeError): Add new class for lifetime parsing errors.
	(enum ParseSelfError): Add new class for self param parsing errors.
	* typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit):
	Use unchecked getter in checked context. And make anonymous region.
	* typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn):
	Likewise.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Add
	check for loop label before visiting it.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* ast/rust-expr.h: Remove error getter and constructor.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* ast/rust-ast-builder.cc (Builder::block): Call with a nullopt instead
	of an error loop label.
	(WhileLetLoopExpr::as_string): Use getter function and adapt to
	newtype.
	* ast/rust-ast.cc (WhileLoopExpr::as_string): Likewise.
	(LoopExpr::as_string): Likewise.
	(BreakExpr::as_string): Likewise.
	(ForLoopExpr::as_string): Likewise.
	* ast/rust-expr.h (class BlockExpr): Make loop label optional.
	(class BreakExpr): Likewise.
	* expand/rust-derive-clone.cc (DeriveClone::clone_fn): Use nullopt.
	* expand/rust-derive-debug.cc (DeriveDebug::stub_debug_fn): Likewise.
	* expand/rust-derive-default.cc (DeriveDefault::default_fn): Likewise.
	* expand/rust-derive-eq.cc: Likewise.
	* parse/rust-parse-impl.h (Parser::parse_block_expr): Use optional
	for arguments.
	(Parser::parse_loop_expr): Likewise.
	(Parser::parse_while_loop_expr): Likewise.
	(Parser::parse_while_let_loop_expr): Likewise.
	(Parser::parse_for_loop_expr): Likewise.
	(Parser::parse_labelled_loop_expr): Likewise.
	(Parser::parse_loop_label): Return an optional.
	* parse/rust-parse.h: Update function prototype and use nullopt for
	default values.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change default
	visit order.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Visit loop label
	only if it exists.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* hir/rust-ast-lower.cc (ASTLoweringBlock::visit): Lower label only if
	it exists.
	* hir/tree/rust-hir-expr.cc (BlockExpr::BlockExpr): Make loop label
	optional.
	(BaseLoopExpr::BaseLoopExpr): Likewise.
	(LoopExpr::LoopExpr): Likewise.
	(WhileLoopExpr::WhileLoopExpr): Likewise.
	* hir/tree/rust-hir-expr.h: Use optional for lifetime and labels.
	* hir/tree/rust-hir.cc (WhileLoopExpr::as_string): Use getter.
	(WhileLetLoopExpr::as_string): Likewise.
	(LoopExpr::as_string): Likewise.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Resolve labels.
	* resolve/rust-late-name-resolver-2.0.h: Add visit function prototype
	for loop labels.

2025-04-08  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* util/expected.h: Use gcc_unreachable within gcc context.

2025-04-08  Sri Ganesh Thota  <sriganeshthota12345@gmail.com>

	* resolve/rust-ast-resolve-base.h (redefined_error): created a function for
	rust_error_at for redefined at multiple times.
	* resolve/rust-ast-resolve-implitem.h: changed rust_error_at to redefined_error.
	* resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): changed rust_error_at to
	redefined_error.
	* resolve/rust-ast-resolve-stmt.h: changed rust_error_at to redefined_error.
	* resolve/rust-ast-resolve-toplevel.h: changed rust_error_at to redefined_error.

2025-04-08  Owen Avery  <powerboat9.gamer@gmail.com>

	* ast/rust-ast-visitor.cc
	(DefaultASTVisitor::visit): Remove explicit visitation of a
	function's self parameter, as if it exists it'll be visited as
	one of the function parameters.

2025-04-08  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-typecheck-context.cc (TypeCheckContext::lookup_lifetime): emit error

2025-04-08  Arthur Cohen  <arthur.cohen@embecosm.com>

	* ast/rust-ast.cc (Function::Function): Rename is_default -> has_default.
	(Function::operator=): Likewise.
	* ast/rust-item.h (class Function): Add `is_default` method.
	* hir/rust-ast-lower-implitem.cc (ASTLowerImplItem::visit): Lower default qualifier.
	* hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
	* hir/tree/rust-hir-item.cc (Function::Function): Add `is_default` member.
	(Function::operator=): Likewise.
	* hir/tree/rust-hir-item.h (enum class Defaultness): New enum.
	(class Function): Use it.

2025-04-08  Arthur Cohen  <arthur.cohen@embecosm.com>

	* checks/errors/rust-feature.cc (Feature::create): Handle `#![feature(min_specialization)]`.
	* checks/errors/rust-feature.h: Likewise.

2025-04-08  Philip Herron  <herron.philip@googlemail.com>

	* resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): fix error msg
	* typecheck/rust-substitution-mapper.cc (SubstMapper::Resolve): add validation
	(SubstMapper::valid_type): new check
	(SubstMapper::visit): check if can resolve
	* typecheck/rust-substitution-mapper.h: new prototype

2025-04-08  Philip Herron  <herron.philip@googlemail.com>

	* backend/rust-compile-base.cc (HIRCompileBase::address_expression): allow optional type
	* backend/rust-compile-base.h: update prototype
	* backend/rust-compile-expr.cc (CompileExpr::visit): update borrow expr
	* backend/rust-compile-extern.h: remove unused debug
	* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): update usage
	* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): lower raw ref
	* hir/tree/rust-hir-expr.cc (BorrowExpr::BorrowExpr): add flag for raw ref
	* hir/tree/rust-hir-expr.h (class BorrowExpr): add new raw ref field
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): add handle for raw ref

2025-04-08  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): emit error

2025-04-08  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): new argument
	* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::TypeCheckBase): new helper
	* typecheck/rust-hir-type-check-base.h: new helper prototype
	* typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
	remove comment out code
	* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): check for null
	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): likewise
	(TypeResolveGenericParam::Resolve): new args
	(TypeResolveGenericParam::ApplyAnyTraitBounds): new helper
	(TypeResolveGenericParam::apply_trait_bounds): new field
	(TypeResolveGenericParam::visit): update
	* typecheck/rust-hir-type-check-type.h: new args
	* typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): reuse helper
	* typecheck/rust-type-util.cc (query_type): check for recursive query
	* typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::SubstitutionParamMapping):
	remove const
	(SubstitutionParamMapping::get_generic_param): likewise
	* typecheck/rust-tyty-subst.h: likewise
	* typecheck/rust-tyty-variance-analysis.cc (GenericTyVisitorCtx::process_type): likewise

2025-04-08  Philip Herron  <herron.philip@googlemail.com>

	* backend/rust-compile-base.cc: new flag is_root_item
	* backend/rust-compile-base.h: update prototype
	* backend/rust-compile-implitem.cc (CompileTraitItem::visit): update call
	* backend/rust-compile-implitem.h: remove old debug internal error
	* backend/rust-compile-item.cc (CompileItem::visit): update call
	* backend/rust-compile-item.h: remove old debug
	* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): update calls
	* backend/rust-compile.cc: likewise
	* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
	remove assertion and error

2025-04-08  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-type-check-base.cc: remove assertion

2025-04-08  Philip Herron  <herron.philip@googlemail.com>

	* rust-gcc.cc (arithmetic_or_logical_expression): unwrap const decls

2025-04-08  Owen Avery  <powerboat9.gamer@gmail.com>

	* resolve/rust-forever-stack.h
	(ForeverStack::ForeverStack): Initialize extern_prelude.
	(ForeverStack::resolve_path): Add parameter
	has_opening_scope_resolution.
	(ForeverStack::extern_prelude): Add field.
	* resolve/rust-forever-stack.hxx: Include rust-edition.h.
	(ForeverStacl::resolve_path): Handle global paths (paths with an
	opening scope resolution operator).
	* resolve/rust-late-name-resolver-2.0.cc
	(Late::visit): Handle global paths.
	* resolve/rust-name-resolution-context.h
	(NameResolutionContext::resolve_path): Handle global paths.

2025-04-08  Ryutaro Okada  <1015ryu88@gmail.com>

	* backend/rust-compile-resolve-path.cc: Evaluate the enum's discriminant in a const context

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
	catch nullptr root_tyty

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options):
	check for null and empty and add missing delete call

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-tyty-subst.h: check for min range

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options): check for input

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* hir/rust-hir-dump.cc (Dump::visit): check has type
	* hir/tree/rust-hir-type.cc (BareFunctionType::BareFunctionType): likewise

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* backend/rust-constexpr.cc (eval_store_expression): turn this back on

2025-03-31  Owen Avery  <powerboat9.gamer@gmail.com>

	* expand/rust-macro-builtins-log-debug.cc:
	Add newline to end of file.

2025-03-31  Owen Avery  <powerboat9.gamer@gmail.com>

	* resolve/rust-forever-stack.h
	(ForeverStack::get_prelude): Rename to...
	(ForeverStack::get_lang_prelude): ...here.
	(ForeverStack::prelude): Rename to...
	(ForeverStack::lang_prelude): ...here.
	(ForeverStack::ForeverStack): Handle renames.
	* resolve/rust-forever-stack.hxx
	(ForeverStack::push_inner): Likewise.
	(ForeverStack::resolve_segments): Likewise.
	(ForeverStack::resolve_path): Likewise.
	(ForeverStack::get_prelude): Rename to...
	(ForeverStack::get_lang_prelude): ...here and handle renames.
	* resolve/rust-late-name-resolver-2.0.cc
	(Late::visit): Handle renames.

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* backend/rust-compile-context.h: only push named types
	* backend/rust-compile-type.cc (TyTyResolveCompile::visit): run the type hasher

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): check for Expr trait
	* hir/rust-hir-dump.cc (Dump::visit): expr is optional

2025-03-31  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* resolve/rust-forever-stack.hxx: Add a new specialized function
	to retrieve the last "real" segment depending on the namespace.
	* resolve/rust-forever-stack.h: Add new function prototype.
	* resolve/rust-early-name-resolver-2.0.cc (Early::finalize_rebind_import):
	Set declared name according to the selected segment, if there is a self
	suffix in the use declaration then select the previous segment.

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* backend/rust-compile-base.cc (HIRCompileBase::unit_expression): pass ctx
	* backend/rust-compile-base.h: cant be static
	* backend/rust-compile-intrinsic.cc (try_handler_inner): pass ctx
	* backend/rust-compile-type.cc
	(TyTyResolveCompile::get_unit_type): update to grab the first locus
	(TyTyResolveCompile::visit): pass ctx
	* backend/rust-compile-type.h: likewise

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-dot-operator.cc:

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): check for super mid path

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* backend/rust-compile-base.cc (HIRCompileBase::address_expression): new helper constexpr
	* backend/rust-compile-base.h: prototype
	* backend/rust-compile-type.cc (TyTyResolveCompile::visit): call constexpr helper

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::resolve_impl_block_substitutions):
	Track the polarity
	* typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::validate_type_implements_this):
	new validator
	* typecheck/rust-tyty.h: new prototypes

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* backend/rust-compile-expr.cc (CompileExpr::array_value_expr): add value chk for array expr

2025-03-31  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-trait-reference.h: add default infer arg
	* typecheck/rust-hir-trait-resolve.cc: dont add new infer vars
	* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): dont infer

2025-03-31  Owen Avery  <powerboat9.gamer@gmail.com>

	* checks/errors/rust-ast-validation.cc
	(ASTValidation::visit): Allow constant items lacking expressions
	if and only if they're associated with a trait definition, not a
	trait implementation.

2025-03-31  Owen Avery  <powerboat9.gamer@gmail.com>

	* hir/rust-ast-lower-base.cc
	(ASTLoweringBase::lower_literal): Lower raw string literals into
	normal string literals.

2025-03-31  Arthur Cohen  <arthur.cohen@embecosm.com>

	* checks/errors/borrowck/ffi-polonius/Cargo.lock: Regenerate.
	* checks/errors/borrowck/ffi-polonius/Cargo.toml: Update to use source patching instead of
	vendoring, lower edition to 2018.
	* checks/errors/borrowck/ffi-polonius/vendor/log/Cargo.toml: Change edition to 2018.
	* checks/errors/borrowck/ffi-polonius/vendor/log/src/lib.rs: Remove uses of unstable
	feature.
	* checks/errors/borrowck/ffi-polonius/.cargo/config.toml: Removed.

2025-03-31  Arthur Cohen  <arthur.cohen@embecosm.com>

	* hir/tree/rust-hir-stmt.h (class LetStmt): Add optional diverging else expression.
	* hir/tree/rust-hir-stmt.cc: Likewise.
	* hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Add handling for lowering
	diverging else.

2025-03-31  Arthur Cohen  <arthur.cohen@embecosm.com>

	* resolve/rust-ast-resolve-stmt.h: Add handling for diverging else.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Likewise.

2025-03-31  Arthur Cohen  <arthur.cohen@embecosm.com>

	* ast/rust-ast-collector.cc (TokenCollector::visit): Add handling for diverging else
	expression.

2025-03-31  Arthur Cohen  <arthur.cohen@embecosm.com>

	* parse/rust-parse-impl.h (Parser::parse_let_stmt): Add new parsing in case of `else` token.

2025-03-31  Arthur Cohen  <arthur.cohen@embecosm.com>

	* ast/rust-stmt.h (class LetStmt): Add optional expression for diverging else.
	* ast/rust-ast-builder.cc (Builder::let): Use new API.

2025-03-26  Iain Sandoe  <iain@sandoe.co.uk>

	* metadata/rust-export-metadata.cc
	(PublicInterface::write_to_path): Use 'lbasename()' instead of
	'basename()'.

2025-03-24  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-path-probe.cc: update call
	* typecheck/rust-hir-trait-reference.cc (TraitReference::lookup_trait_item): track predicate
	(TraitReference::is_equal): likewise
	(TraitReference::is_object_safe): likewise
	(TraitReference::satisfies_bound): likewise
	* typecheck/rust-hir-trait-reference.h: likewise
	* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): likewise
	* typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::TypeBoundPredicate): track super traits
	(TypeBoundPredicate::operator=): likewise
	(TypeBoundPredicate::apply_generic_arguments): ensure we apply to super predicates
	(TypeBoundPredicateItem::operator=): take copy of parent predicate
	(TypeBoundPredicateItem::error): pass error instead of nullptr
	(TypeBoundPredicateItem::is_error): update to no longer check for nullptr
	(TypeBoundPredicateItem::get_parent): updated
	(TypeBoundPredicateItem::get_tyty_for_receiver): likewise
	(TypeBoundPredicate::get_associated_type_items): likewise
	* typecheck/rust-tyty-bounds.h (class TypeBoundPredicateItem): move
	* typecheck/rust-tyty-subst.cc: flag to handle placeholder Self on traits
	* typecheck/rust-tyty-subst.h (class TypeBoundPredicateItem): likewise
	* typecheck/rust-tyty.h (class TypeBoundPredicateItem): refactored

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* resolve/rust-late-name-resolver-2.0.cc
	(Late::visit): Add visitor for StructExprFieldIdentifier.
	* resolve/rust-late-name-resolver-2.0.h
	(Late::visit): Likewise.

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* resolve/rust-late-name-resolver-2.0.cc
	(Late::visit): Make sure to return early after a resolution
	error, improve the resolution error message, fix a typo, handle
	ambiguous resolutions, and remove an old comment.

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* resolve/rust-ast-resolve-expr.cc
	(ResolveExpr::visit): Modify error message.
	* resolve/rust-ast-resolve-implitem.h
	(ResolveToplevelImplItem::visit): Likewise.
	(ResolveTopLevelTraitItems::visit): Likewise.
	(ResolveToplevelExternItem::visit): Likewise.
	* resolve/rust-ast-resolve-stmt.cc
	(ResolveStmt::visit): Likewise.
	* resolve/rust-ast-resolve-stmt.h
	(ResolveStmt::visit): Likewise.
	* resolve/rust-ast-resolve-toplevel.h
	(ResolveTopLevel::visit): Likewise.
	* resolve/rust-ast-resolve-type.h
	(ResolveGenericParams::visit): Likewise.

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* ast/rust-ast-visitor.cc
	(DefaultASTVisitor::visit): Make sure to always visit the struct
	name.
	* resolve/rust-late-name-resolver-2.0.cc
	(Late::visit): Avoid visiting the struct name twice.

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* expand/rust-derive-clone.cc
	(DeriveClone::clone_impl): Avoid using the same node id multiple
	times.
	(DeriveClone::clone_enum_identifier): Likewise.
	(DeriveClone::clone_enum_tuple): Likewise.
	* expand/rust-derive-copy.cc
	(DeriveCopy::copy_impl): Likewise.
	* resolve/rust-ast-resolve-item.cc
	(flatten_list): Likewise.
	* resolve/rust-ast-resolve-path.cc
	(ResolvePath::resolve_path): Prevent reinsertion of resolutions.
	* resolve/rust-ast-resolve-type.cc
	(ResolveRelativeTypePath::go): Likewise.
	* typecheck/rust-hir-type-check-expr.cc
	(TypeCheckExpr::resolve_fn_trait_call): Likewise.
	* resolve/rust-name-resolver.cc
	(Resolver::insert_resolved_name): Catch multiple resolution
	insertions.
	(Resolver::insert_resolved_type): Likewise.

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* resolve/rust-ast-resolve-path.cc
	(ResolvePath::resolve_path): Adjust the error message for a lower
	self segment in the middle of a path.
	* resolve/rust-ast-resolve-type.cc
	(ResolveRelativeTypePath::go): Likewise.

2025-03-24  Ryutaro Okada  <1015ryu88@gmail.com>

	* typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
		emit an error for type or const parameters on foreign items

2025-03-24  Liam Naddell  <liamnprg@gmail.com>

	* resolve/rust-forever-stack.h (ForeverStack): Add a dedicated prelude node for
	the Language prelude
	* resolve/rust-forever-stack.hxx (ForeverStack): Add support code for the
	prelude node
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Move
	language prelude builtins to the prelude context
	* resolve/rust-name-resolution-context.cc
	(NameResolutionContext::scoped): Add code for handling
	the prelude corner case
	* resolve/rust-rib.h (Rib::Kind): Add a special Prelude rib type

2025-03-24  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* resolve/rust-forever-stack.hxx: Fix the id comparison.

2025-03-24  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* resolve/rust-forever-stack.hxx: Insert a new segment with the crate's
	name as canonical's path prefix.

2025-03-24  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* util/rust-hir-map.cc (Mappings::lookup_crate_num): Add function to
	retrieve crate number from it's node id.
	(Mappings::node_is_crate): change function with call to
	lookup_crate_num to avoid looping through all crates.
	(Mappings::insert_ast_crate): Populate node id to crate number map.
	* util/rust-hir-map.h: Change function prototype.

2025-03-24  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* resolve/rust-finalize-imports-2.0.cc (FinalizeImports::FinalizeImports):
	Remove constructor.
	(FinalizeImports::go): Remove function.
	(FinalizeImports::visit): Likewise.
	* resolve/rust-finalize-imports-2.0.h (class FinalizeImports): Remove
	FinalizeImports class.

2025-03-24  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* resolve/rust-early-name-resolver-2.0.cc (Early::Early): Move the
	top level visitor from the function scope to attributes.
	(Early::go): Remove top level visitor creation and adapt calling code.
	Remove call to mapping resolution and import finalization.
	(Early::finalize_simple_import): Move the finalization from it's
	visitor.
	(Early::finalize_glob_import): Likewise.
	(Early::finalize_rebind_import): Likewise.
	(Early::visit): Add mapping resolution and finalization in
	UseDeclaration visitor function.
	* resolve/rust-finalize-imports-2.0.cc (finalize_simple_import): Move
	function.
	(finalize_glob_import): Likewise.
	(finalize_rebind_import): Likewise.
	(FinalizeImports::visit): Remove call to finalizers.
	* resolve/rust-early-name-resolver-2.0.h (class Early): Add top level
	attribute.
	* resolve/rust-finalize-imports-2.0.h: Add function prototypes.
	* resolve/rust-toplevel-name-resolver-2.0.h: Change getter return type
	to reference.

2025-03-24  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-trait-resolve.cc (TraitResolver::ResolveHirItem): new helper
	* typecheck/rust-hir-trait-resolve.h: add helper prototype
	* typecheck/rust-type-util.cc (query_type): add debug
	* typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): check for recursion
	* typecheck/rust-tyty.cc (VariantDef::is_equal): fix is equal check

2025-03-24  Philip Herron  <herron.philip@googlemail.com>

	* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): track DefId of origin
	* typecheck/rust-tyty.cc (BaseType::monomorphized_clone): likewise
	(ADTType::ADTType): likewise
	(ADTType::get_id): likewise
	(ADTType::clone): likewise
	* typecheck/rust-tyty.h: likewise

2025-03-24  Philip Herron  <herron.philip@googlemail.com>

	* backend/rust-compile-resolve-path.cc (ResolvePathRef::Compile): remove visitor
	(ResolvePathRef::ResolvePathRef): likewise
	(ResolvePathRef::visit): likewise
	* backend/rust-compile-resolve-path.h (class ResolvePathRef): likewise

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* backend/rust-compile-intrinsic.cc
	(assume_handler): Fix copy/paste error.
	* typecheck/rust-hir-type-check-pattern.cc
	(TypeCheckPattern::visit): Fix spelling mistake.

2025-03-24  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* resolve/rust-rib.cc (Rib::Definition::to_string): Add enum variant
	status.

2025-03-24  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* resolve/rust-forever-stack.h: Add new function to insert enum
	variants and add argument to resolver's get function to explicitely
	skip enum variants.
	* resolve/rust-forever-stack.hxx: Update function
	definitions.
	* resolve/rust-name-resolution-context.cc (NameResolutionContext::insert_variant):
	Add function to insert enum variants.
	* resolve/rust-name-resolution-context.h: Add function's prototype.
	* resolve/rust-rib.cc (Rib::Definition::Definition): Add new boolean to
	hint at enum variant provenance.
	(Rib::Definition::is_variant): New getter for variant status.
	(Rib::Definition::Shadowable): Update constructor to opt out of enum
	variants.
	(Rib::Definition::Globbed): Likewise.
	(Rib::Definition::NonShadowable): Change constructor to forward enum
	variant provenance status.
	* resolve/rust-rib.h: Update function prototypes.
	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::insert_enum_variant_or_error_out):
	Add function to insert enum variants in the name resolver.
	(TopLevel::visit): Update several enum variant's visitor function
	with the new enum variant name resolving code.
	* resolve/rust-toplevel-name-resolver-2.0.h: Update function
	prototypes.

2025-03-24  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>

	* resolve/rust-forever-stack.hxx: Output rib kind.
	* resolve/rust-rib.h: Add function to get string representation from
	a rib kind.

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* resolve/rust-forever-stack.h
	(ForeverStack::ForeverStack): Set the node id of the root node
	to that of the current crate.
	* resolve/rust-forever-stack.hxx
	(ForeverStack::find_starting_point): Use the node id of the root
	node during resolution of crate segments.

2025-03-24  Arthur Cohen  <arthur.cohen@embecosm.com>

	* expand/rust-macro-expand.cc: Use new SubstituteCtx API.
	* expand/rust-macro-expand.h: Likewise.
	* expand/rust-macro-substitute-ctx.cc: Implement proper expansion of $crate.
	* expand/rust-macro-substitute-ctx.h: Adapt APIs to take macro definition when
	substituting.
	* util/rust-hir-map.cc (Mappings::insert_macro_def): Store crate information when
	inserting macro definition in mappings.
	(Mappings::lookup_macro_def_crate): New.
	* util/rust-hir-map.h: Adapt mappings to store crate in which macros were defined.

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* resolve/rust-late-name-resolver-2.0.cc
	(Late::visit): Call DefaultResolver::visit earlier, in order to
	ensure it is called even if Late::visit returns early.

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* util/rust-edition.cc: New file.
	* util/rust-edition.h: New file.
	* Make-lang.in: Add rust-edition.o to the object list.
	* ast/rust-pattern.cc: Remove inclusion of
	rust-session-manager.h.
	* expand/rust-macro-expand.cc: Likewise.
	* expand/rust-macro-builtins-helpers.h: Likewise.
	* expand/rust-macro-builtins-include.cc: Include
	rust-session-manager.h.
	* expand/rust-macro-builtins-utility.cc: Likewise.
	* lex/rust-lex.cc: Include rust-edition.h instead of
	rust-session-manager.h.
	(Lexer::classify_keyword): Use get_rust_edition instead of
	Session and CompileOptions.
	* parse/rust-parse-impl.h: Include rust-edition.h instead of
	rust-session-manager.h.
	(Parser::parse_async_item): Use get_rust_edition instead of
	Session and CompileOptions.
	* checks/errors/rust-feature.h: Include rust-edition.h instead
	of rust-session-manager.h.
	(class Feature): Use Rust::Edition instead of
	Rust::CompileOptions::Edition.

2025-03-24  Arthur Cohen  <arthur.cohen@embecosm.com>

	* rust-session-manager.cc (Session::compile_crate): Call DesugarQuestionMark::go().

2025-03-24  Arthur Cohen  <arthur.cohen@embecosm.com>

	* hir/rust-ast-lower-base.cc: Adapt functions for ErrorPropagationExpr and MacroInvocation.
	* hir/rust-ast-lower-base.h: Mark them as final.
	* hir/rust-ast-lower-expr.cc: Remove previous definition for those overrides.
	* hir/rust-ast-lower-expr.h: Likewise.

2025-03-24  Arthur Cohen  <arthur.cohen@embecosm.com>

	* Make-lang.in: Compile it.
	* ast/rust-desugar-question-mark.cc: New file.
	* ast/rust-desugar-question-mark.h: New file.

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* resolve/rust-early-name-resolver-2.0.cc
	(Early::visit): Adjust error produced when macro resolution
	fails.
	* resolve/rust-early-name-resolver.cc
	(EarlyNameResolver::visit): Likewise.

2025-03-24  Owen Avery  <powerboat9.gamer@gmail.com>

	* resolve/rust-forever-stack.hxx
	(ForeverStack::find_starting_point): Stop when hitting a lang
	item segment.
	(ForeverStack::resolve_segments): Resolve lang item segments.
	(ForeverStacl::resolve_path): Handle single segment lang item
	paths and add comment.
	* util/rust-unwrap-segment.cc
	(unwrap_segment_get_lang_item): Add.
	* util/rust-unwrap-segment.h
	(unwrap_segment_get_lang_item): Add.

2025-03-24  Arthur Cohen  <arthur.cohen@embecosm.com>

