Skip to content

Conversation

@dkm
Copy link
Member

@dkm dkm commented Oct 31, 2025

This is a sync with upstream GCC:

-- gerris 🦀

(well, a bit manually, because there was some issue with revert commit that were not upstream and did not apply)

P-E-P and others added 30 commits October 30, 2025 20:58
gcc/testsuite/ChangeLog:

	* rust/compile/impl_fnptr.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
This improves our handling of PathInExpression and fixes
#4056.

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_expr): Avoid skipping
	or splitting tokens.
	(Parser::null_denotation): Assume initial token was not skipped
	and adjust function signature to match. Use
	parse_path_in_expression instead of
	parse_path_in_expression_pratt and handle SCOPE_RESOLUTION.
	(Parser::parse_path_in_expression_pratt): Remove function.
	* parse/rust-parse.h (null_denotation): Remove initial token
	parameter.
	(parse_path_in_expression_pratt): Remove function.

gcc/testsuite/ChangeLog:

	* rust/compile/global-path-array.rs: New test.

Signed-off-by: Owen Avery <[email protected]>
This allows format_args!(some_macro!(...), ...) to compile.

gcc/rust/ChangeLog:

	* expand/rust-macro-builtins-format-args.cc
	(format_args_parse_arguments): Split format expression parsing
	into...
	(format_args_parse_expr): ...a new function here, while handling
	eager expansion.
	(MacroBuiltin::format_args_handler): Use format_args_parse_expr.

gcc/testsuite/ChangeLog:

	* rust/compile/format_args_concat.rs: New test.

Signed-off-by: Owen Avery <[email protected]>
gcc/rust/ChangeLog:

	* ast/rust-ast-collector.cc (TokenCollector::visit): Use
	should_have_str instead of has_str.
	* ast/rust-ast.cc (Token::as_string): Likewise.
	* expand/rust-macro-builtins-offset-of.cc
	(MacroBuiltin::offset_of_handler): Likewise.
	* lex/rust-lex.cc (Lexer::dump_and_skip): Likewise.
	* ast/rust-ast.h (class Token): Remove dead code.
	(Token::has_str): Remove function.
	(Token::should_have_str): New function.
	* lex/rust-token.cc (Token::get_str): Remove function
	definition.
	* lex/rust-token.h: Include "rust-diagnostics.h".
	(Token::str): Change type from std::unique_ptr<std::string> to
	std::string.
	(Token::Token): Adjust initialization of str member variable and
	the type of the parameter used to initialize it.
	(Token::make_identifier): Accept std::string instead of rvalue
	reference to std::string.
	(Token::make_int): Likewise.
	(Token::make_float): Likewise.
	(Token::make_string): Likewise.
	(Token::make_byte_string): Likewise.
	(Token::make_raw_string): Likewise.
	(Token::make_inner_doc_comment): Likewise.
	(Token::make_outer_doc_comment): Likewise.
	(Token::make_lifetime): Likewise.
	(Token::get_str): Add definition to function declaration.
	(Token::has_str): Remove member function.
	(Token::should_have_str): Handle INNER_DOC_COMMENT and
	OUTER_DOC_COMMENT.

Signed-off-by: Owen Avery <[email protected]>
Patterns include TuplePattern, TupleStructPattern & SlicePattern. Besides making their pattern
items container class inherit from a common `PatternItems` base class just like in HIR for
better standardization, mentions of `Range` are also changed to `HasRest` or `NoRest`.

gcc/rust/ChangeLog:

	* ast/rust-pattern.h:
		- Add a new base abstract class `PatternItems` which are used by pattern items class
		class derivatives for `TuplePattern`, `TupleStructPattern` & `SlicePattern`.
		- Standardized the derived class names to have `HasRest` or `NoRest` as suffixes.
		 - Values for the common `ItemType` enum is updated to `HAS_REST` or `NO_REST`.
	* ast/rust-pattern.cc: Renamed the classes accordingly.
	* ast/rust-ast-collector.cc: Renamed the classes accordingly.
	* ast/rust-ast-collector.h: Renamed the classes accordingly.
	* ast/rust-ast-full-decls.h: Renamed the classes accordingly.
	* ast/rust-ast-visitor.cc: Renamed the classes accordingly.
	* ast/rust-ast-visitor.h: Renamed the classes accordingly.
	* ast/rust-desugar-for-loops.cc: Renamed the classes accordingly.
	* ast/rust-desugar-question-mark.cc: Renamed the classes accordingly.
	* expand/rust-cfg-strip.cc: Renamed the classes accordingly.
	* expand/rust-cfg-strip.h: Renamed the classes accordingly.
	* expand/rust-derive-clone.cc: Renamed the classes accordingly.
	* expand/rust-derive-cmp-common.cc: Renamed the classes accordingly.
	* expand/rust-derive-hash.cc: Renamed the classes accordingly.
	* expand/rust-derive-ord.cc: Renamed the classes accordingly.
	* expand/rust-derive-partial-eq.cc: Renamed the classes accordingly.
	* expand/rust-derive.h: Renamed the classes accordingly.
	* expand/rust-expand-visitor.cc: Renamed the classes accordingly.
	* expand/rust-expand-visitor.h: Renamed the classes accordingly.
	* hir/rust-ast-lower-base.cc: Renamed the classes accordingly.
	* hir/rust-ast-lower-base.h: Renamed the classes accordingly.
	* hir/rust-ast-lower-pattern.cc: Renamed the classes accordingly.
	* hir/tree/rust-hir-pattern.h: Renamed the classes accordingly.
	* parse/rust-parse-impl.h: Renamed the classes accordingly.
	* resolve/rust-ast-resolve-base.cc: Renamed the classes accordingly.
	* resolve/rust-ast-resolve-base.h: Renamed the classes accordingly.
	* resolve/rust-ast-resolve-pattern.cc: Renamed the classes accordingly.
	* util/rust-attributes.cc: Renamed the classes accordingly.
	* util/rust-attributes.h: Renamed the classes accordingly.

Signed-off-by: Yap Zhi Heng <[email protected]>
gcc/rust/ChangeLog:

	* checks/errors/privacy/rust-privacy-check.cc: Adjust includes.
	(Resolver::resolve): Pass 2.0 name resolution context to
	VisibilityResolver and PrivacyReporter.
	* checks/errors/privacy/rust-privacy-reporter.cc
	(PrivacyReporter::PrivacyReporter): Change type of resolver
	parameter.
	(is_child_module): Remove static function.
	(PrivacyReporter::check_for_privacy_violation): Assume nr2.0 is
	enabled and handle removal of is_child_module.
	* checks/errors/privacy/rust-privacy-reporter.h: Adjust
	includes.
	(PrivacyReporter::PrivacyReporter): Change type of resolver
	parameter.
	(PrivacyReporter::resolver): Change member variable type.
	* checks/errors/privacy/rust-visibility-resolver.cc: Adjust
	includes.
	(VisibilityResolver::VisibilityResolver): Change type of
	resolver parameter.
	(VisibilityResolver::resolve_module_path): Assume nr2.0 is
	enabled.
	* checks/errors/privacy/rust-visibility-resolver.h: Adjust
	includes.
	(VisibilityResolver::VisibilityResolver): Change type of
	resolver parameter.
	(VisibilityResolver::resolver): Change member variable type.

Signed-off-by: Owen Avery <[email protected]>
gcc/rust/ChangeLog:

	* rust-session-manager.cc: Remove inclusion of name resolution
	1.0 headers.
	(Session::compile_crate): Assume name resolution 2.0 is enabled.
	(Session::expansion): Likewise.
	(Session::load_extern_crate): Likewise.

Signed-off-by: Owen Avery <[email protected]>
gcc/rust/ChangeLog:

	* checks/errors/rust-hir-pattern-analysis.cc: Remove inclusion
	of "options.h".
	(PatternChecker::PatternChecker): Change initialization of
	resolver reference.
	(PatternChecker::visit): Assume name resolution 2.0 is enabled.
	* checks/errors/rust-hir-pattern-analysis.h: Include nr2.0
	header instead of nr1.0 header.
	(PatternChecker::resolver): Change type to nr2.0 resolver.

Signed-off-by: Owen Avery <[email protected]>
gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-builder-internal.h: Remove
	inclusion of "rust-name-resolver.h".
	(BuilderContext::resolver): Change type to nr2.0 resolver.
	(BuilderContext::BuilderContext): Change initialization of
	resolver reference.
	(AbstractBuilder::resolve_label): Assume name resolution 2.0 is
	enabled.
	(AbstractBuilder::resolve_variable): Likewise.
	(AbstractBuilder::resolve_variable_or_fn): Likewise.

Signed-off-by: Owen Avery <[email protected]>
Marking a TupleIndexExpr for strip makes it invalid for a generic visitor

gcc/rust/ChangeLog:

	* ast/rust-expr.h (class TupleIndexExpr): Store strip information.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
gcc/rust/ChangeLog:

	* Make-lang.in: Compile it.
	* ast/rust-builtin-ast-nodes.h: Add missing methods for getting pointers.
	* ast/rust-expr.h: Likewise.
	* ast/rust-item.h: Likewise.
	* ast/rust-path.h: Likewise.
	* ast/rust-pattern.h: Likewise.
	* ast/rust-type.h: Likewise.
	* ast/rust-ast-pointer-visitor.cc: New file.
	* ast/rust-ast-pointer-visitor.h: New file.
gcc/rust/ChangeLog:

	* ast/rust-expression-yeast.cc (ExpressionYeast::dispatch): Rename to...
	(ExpressionYeast::reseat): ...this.
	(ExpressionYeast::visit): Remove.
	* ast/rust-expression-yeast.h: Inherit from PointerVisitor, override reseat instead
	of declaring dispatch.
gcc/rust/ChangeLog:

	* rust-session-manager.cc (Session::compile_crate): Move the AST dump
	after parser error check.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
Unlike in C, floating point literals can't start with a '.', and
therefore could never be split into a '.' followed by an integer.

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::left_denotation): Remove
	usage of parse_tuple_index_expr_float.
	(Parser::parse_closure_expr_pratt): Remove function.

gcc/testsuite/ChangeLog:

	* rust/compile/parse_float_dot.rs: New test.

Signed-off-by: Owen Avery <[email protected]>
gcc/rust/ChangeLog:

	* Make-lang.in (GRS_OBJS): Add "rust-resolve-builtins.o".
	* resolve/rust-late-name-resolver-2.0.cc: Include
	"rust-resolve-builtins.h".
	(next_node_id): Remove function.
	(next_hir_id): Likewise.
	(Late::setup_builtin_types): Likewise.
	(Late::go): Use Builtins::setup_type_ctx instead of
	Late::setup_builtin_types.
	* resolve/rust-late-name-resolver-2.0.h
	(Late::setup_builtin_types): Remove function.
	* rust-session-manager.cc: Include "rust-resolve-builtins.h".
	(Session::expansion): Call Builtins::setup_lang_prelude.
	* resolve/rust-resolve-builtins.cc: New file.
	* resolve/rust-resolve-builtins.h: New file.

gcc/testsuite/ChangeLog:

	* rust/compile/primitive-import.rs: New test.

Signed-off-by: Owen Avery <[email protected]>
gcc/rust/ChangeLog:

	* resolve/rust-early-name-resolver-2.0.cc (Early::visit): Emit an error
	on top level rebind self use declaration.

gcc/testsuite/ChangeLog:

	* rust/compile/use_self_alone.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
gcc/rust/ChangeLog:

	* resolve/rust-early-name-resolver-2.0.cc (Early::finalize_rebind_import):
	Replace assert with early break and remove early return.
	(Early::visit): Check for unsuffixed lower self list.
	* resolve/rust-early-name-resolver-2.0.h: Add visit function prototype.

gcc/testsuite/ChangeLog:

	* rust/compile/use_self_alone_in_list.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
This interface is not respecting the coercion api commit is always false,
we need to ensure this is respected via the try flag like the rest of the
coercion logic.

gcc/rust/ChangeLog:

	* typecheck/rust-coercion.cc (TypeCoercionRules::select): respect try flag

Signed-off-by: Philip Herron <[email protected]>
I needed to remove som usage of const so we can get rid of can_eq in
type bounds probe. This means we can use the types_compatable interface
instead. Which is much better.

gcc/rust/ChangeLog:

	* backend/rust-compile-base.h: remove const
	* backend/rust-compile-expr.cc: likewise
	* backend/rust-compile.cc (HIRCompileBase::coerce_to_dyn_object): likewise
	* typecheck/rust-hir-type-bounds.h: likewise
	* typecheck/rust-type-util.cc (lookup_associated_impl_block): likewise
	* typecheck/rust-type-util.h (lookup_associated_impl_block): likewise
	* typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::TypeBoundsProbe): likewise
	(TypeBoundsProbe::Probe): likewise
	* typecheck/rust-tyty-cmp.h: likewise
	* typecheck/rust-tyty-subst.cc (SubstitutionRef::monomorphize): likewise
	* typecheck/rust-tyty.cc (BaseType::satisfies_bound): likewise
	(BaseType::bounds_compatible): likewise
	(VariantDef::clone): likewise
	(VariantDef::monomorphized_clone): likewise
	(OpaqueType::is_equal): likewise
	(DynamicObjectType::is_equal): likewise
	* typecheck/rust-tyty.h: likewise

Signed-off-by: Philip Herron <[email protected]>
We use the types compatable interface for unify here and so if
we dont respect the commit flag the interface can have unintended
side effects with infer type hints throwing things off down the line.

gcc/rust/ChangeLog:

	* typecheck/rust-unify.cc (UnifyRules::expect_inference_variable): dont commit
	(UnifyRules::expect_adt): likewise
	(UnifyRules::expect_bool): likewise
	(UnifyRules::expect_char): likewise
	(UnifyRules::expect_int): likewise
	(UnifyRules::expect_uint): likewise
	(UnifyRules::expect_float): likewise
	(UnifyRules::expect_isize): likewise
	(UnifyRules::expect_usize): likewise

Signed-off-by: Philip Herron <[email protected]>
Getting close to getting rid of can_eq and tyty-cmp soon.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-path-probe.cc (PathProbeType::process_impl_item_candidate):
	refactor to types_compatable

Signed-off-by: Philip Herron <[email protected]>
We need to make the type bounds check a flag because it can turn into a
recursive type bounds check. This allows us to remove another can_eq usage

gcc/rust/ChangeLog:

	* typecheck/rust-type-util.cc (types_compatable):  add check bounds flag
	(unify_site_and): likewise
	* typecheck/rust-type-util.h (types_compatable): likewise
	(unify_site_and): likewise
	* typecheck/rust-tyty-bounds.cc: likewise
	* typecheck/rust-unify.cc (UnifyRules::UnifyRules): likewise
	(UnifyRules::Resolve): likewise
	(UnifyRules::resolve_subtype): likewise
	(UnifyRules::go): likewise
	* typecheck/rust-unify.h: likewise

Signed-off-by: Philip Herron <[email protected]>
gcc/rust/ChangeLog:

	* typecheck/rust-tyty.cc (BaseType::satisfies_bound): use types_compatable instead

gcc/testsuite/ChangeLog:

	* rust/compile/issue-1725-2.rs: remove bad error message

Signed-off-by: Philip Herron <[email protected]>
We should only clone when we commit and it was successful. With no
cloning there is a regression in min specialization 2. Probably because
it needs to know the unify site hirid and ensure we have it set there.

gcc/rust/ChangeLog:

	* typecheck/rust-unify.cc (UnifyRules::Resolve): check for success
	(UnifyRules::expect_inference_variable): dont clone
	(UnifyRules::expect_adt): likewise
	(UnifyRules::expect_str): likewise
	(UnifyRules::expect_reference): likewise
	(UnifyRules::expect_pointer): likewise
	(UnifyRules::expect_param): likewise
	(UnifyRules::expect_array): likewise
	(UnifyRules::expect_slice): likewise
	(UnifyRules::expect_fndef): likewise
	(UnifyRules::expect_fnptr): likewise
	(UnifyRules::expect_tuple): likewise
	(UnifyRules::expect_bool): likewise
	(UnifyRules::expect_char): likewise
	(UnifyRules::expect_int): likewise
	(UnifyRules::expect_uint): likewise
	(UnifyRules::expect_float): likewise
	(UnifyRules::expect_isize): likewise
	(UnifyRules::expect_usize): likewise
	(UnifyRules::expect_never): likewise
	(UnifyRules::expect_placeholder): likewise
	(UnifyRules::expect_projection): likewise
	(UnifyRules::expect_dyn): likewise
	(UnifyRules::expect_closure): likewise

Signed-off-by: Philip Herron <[email protected]>
During unification we denote failures using a new error mark node. This
keeps a static one and reuses it instead.

gcc/rust/ChangeLog:

	* typecheck/rust-unify.cc (unify_error_type_node): new static node
	(UnifyRules::go): likewise
	(UnifyRules::expect_inference_variable): likewise
	(UnifyRules::expect_adt): likewise
	(UnifyRules::expect_str): likewise
	(UnifyRules::expect_reference): likewise
	(UnifyRules::expect_pointer): likewise
	(UnifyRules::expect_param): likewise
	(UnifyRules::expect_array): likewise
	(UnifyRules::expect_slice): likewise
	(UnifyRules::expect_fndef): likewise
	(UnifyRules::expect_fnptr): likewise
	(UnifyRules::expect_tuple): likewise
	(UnifyRules::expect_bool): likewise
	(UnifyRules::expect_char): likewise
	(UnifyRules::expect_int): likewise
	(UnifyRules::expect_uint): likewise
	(UnifyRules::expect_float): likewise
	(UnifyRules::expect_isize): likewise
	(UnifyRules::expect_usize): likewise
	(UnifyRules::expect_never): likewise
	(UnifyRules::expect_placeholder): likewise
	(UnifyRules::expect_projection): likewise
	(UnifyRules::expect_dyn): likewise
	(UnifyRules::expect_closure): likewise
	(UnifyRules::expect_opaque): likewise
	(UnifyRules::expect_const): likewise

Signed-off-by: Philip Herron <[email protected]>
gcc/rust/ChangeLog:

	* typecheck/rust-tyty.cc (ParamType::is_equal): uses types_compatable

Signed-off-by: Philip Herron <[email protected]>
This was an initial helper from back in the day which was not maintained
but was a nice const simple way to check if types are compatable. But
reusing our unify code is much much more acurate and single source of
truth on the type system.

gcc/rust/ChangeLog:

	* typecheck/rust-tyty.cc (InferType::can_eq): remove
	(ErrorType::can_eq): likewise
	(ADTType::can_eq): likewise
	(TupleType::can_eq): likewise
	(FnType::can_eq): likewise
	(FnPtr::can_eq): likewise
	(ClosureType::can_eq): likewise
	(ArrayType::can_eq): likewise
	(SliceType::can_eq): likewise
	(BoolType::can_eq): likewise
	(IntType::can_eq): likewise
	(UintType::can_eq): likewise
	(FloatType::can_eq): likewise
	(USizeType::can_eq): likewise
	(ISizeType::can_eq): likewise
	(CharType::can_eq): likewise
	(ReferenceType::can_eq): likewise
	(PointerType::can_eq): likewise
	(ParamType::can_eq): likewise
	(ConstType::can_eq): likewise
	(OpaqueType::can_eq): likewise
	(StrType::can_eq): likewise
	(NeverType::can_eq): likewise
	(PlaceholderType::can_eq): likewise
	(ProjectionType::can_eq): likewise
	(DynamicObjectType::can_eq): likewise
	* typecheck/rust-tyty.h: remove can_eq
	* typecheck/rust-tyty-cmp.h: Removed.

Signed-off-by: Philip Herron <[email protected]>
gcc/rust/ChangeLog:

	* typecheck/rust-tyty.cc (VariantDef::clone): fix formatting
	(VariantDef::monomorphized_clone): likewise
	* typecheck/rust-tyty.h: likewise

Signed-off-by: Philip Herron <[email protected]>
gcc/rust/ChangeLog:

	* typecheck/rust-tyty-subst.cc: const generic arguments dont have a value yet

Signed-off-by: Philip Herron <[email protected]>
gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-base.cc (walk_types_to_constrain): track the ref as well

Signed-off-by: Philip Herron <[email protected]>
philberty and others added 22 commits October 31, 2025 21:29
Its broken at the moment.

ChangeLog:

	* .github/workflows/ccpp.yml: comment it out

Signed-off-by: Philip Herron <[email protected]>
ChangeLog:

	* .github/workflows/ccpp.yml: Update actions/upload-artifact
	from v3 to v4, handle any artifact name conflicts.
	* .github/workflows/ccpp32alpine.yml: Likewise.

Signed-off-by: Owen Avery <[email protected]>
Disable network access via 'unshare' in two CI workflows to catch issues
like PR119333 where importing polonius meant bootstrap tried to pull crates
from the internet.

ChangeLog:
	PR rust/119333

	* .github/workflows/bootstrap.yml: Disable network via 'unshare'.
	* .github/workflows/ccpp.yml: Ditto.
ChangeLog:

	* .github/glibcxx_ubuntu64b_log_expected_warnings: Change line number
	for warning from 2230 to 2236.
	* .github/log_expected_warnings: Likewise.
Bump clang-format version to 16. This is needed as upstream has updated
the config and clang-format 10 doesn't support it.

ChangeLog:
	* .github/workflows/clang-format.yml: Bump clang-format version.

Signed-off-by: Marc Poulhiès <[email protected]>
ChangeLog:

	* .github/alpine_32bit_log_warnings: Adjust with latest warnings.
	* .github/glibcxx_ubuntu64b_log_expected_warnings: Likewise.
	* .github/log_expected_warnings: Likewise.

Signed-off-by: Marc Poulhiès <[email protected]>
ChangeLog:

	* .github/workflows/ccpp.yml: Reenable macos runner, add some
	empty lines to improve formatting.

Signed-off-by: Owen Avery <[email protected]>
This should make it easier for us to ignore warnings from outside the
rust front end, and therefore make it easier for us to pull from
upstream.

ChangeLog:

	* .github/alpine_32bit_log_warnings: Remove lines.
	* .github/glibcxx_ubuntu64b_log_expected_warnings: Likewise.
	* .github/log_expected_warnings: Likewise.
	* .github/workflows/ccpp.yml: Filter out non-rust warnings.
	* .github/workflows/ccpp32alpine.yml: Likewise and remove
	redundant command.
	* .github/safe-grep: New shell script.

Signed-off-by: Owen Avery <[email protected]>
After previous change, removed the last warning from the
expected file.

ChangeLog:

	* .github/glibcxx_ubuntu64b_log_expected_warnings: Remove warning.
	* .github/log_expected_warnings: Likewise.

Signed-off-by: Marc Poulhiès <[email protected]>
GitHub states it will be retiring macos-13 on the 14th of November.
Merging in a fork of GCC with arm64 support is ugly, but I'm not sure
how else to fix this.

ChangeLog:

	* .github/workflows/ccpp.yml: Use macos-15 instead of macos-13,
	manually specify prerequisite header locations, and merge in a
	fork of GCC with support for arm64.

Signed-off-by: Owen Avery <[email protected]>
ChangeLog:

	* .github/workflows/ccpp.yml: Define author name and email while
	creating merge commit.

Signed-off-by: Owen Avery <[email protected]>
… this

Change this formatting, so clang format stops formatting this wierd for me.

gcc/rust/ChangeLog:

	* typecheck/rust-tyty.cc (VariantDef::clone): remove template param
	(VariantDef::monomorphized_clone): likewise

Signed-off-by: Philip Herron <[email protected]>
This reverts commit a50fb38 as it breaks
gcc5 bootstrap.

gcc/rust/ChangeLog:

	* typecheck/rust-tyty.cc (VariantDef::clone): revert
	(VariantDef::monomorphized_clone): likewise

Signed-off-by: Philip Herron <[email protected]>
I dont think this is really being used and its failing.

ChangeLog:

	* .github/workflows/docker.yml: Removed.

Signed-off-by: Philip Herron <[email protected]>
ChangeLog:

	* .github/workflows/ccpp.yml: Change the commit to merge in from
	https://github.com/iains/gcc-darwin-arm64 and improve related
	comment.

Signed-off-by: Owen Avery <[email protected]>
contrib/ChangeLog:

	* gcc-changelog/git_commit.py (ignored_prefixes): Add
	'libgrust/rustc-lib/stdarch/'.

Signed-off-by: Owen Avery <[email protected]>
This new workflow is used to send emails to the gcc-patches@ mailing list
after every merged PR.

For each merged PR:
- remove commits touching files not to-be-upstreamed (e.g. github
workflow, README.md, ...)
- send a mail series

Each mail contains explanation + links to commits on the github project.

Authors of commits will be put in Cc: of emails.

Configure it by setting the following secrets in github:
- PATCH_TO: the "To:" field for the emails
- PATCH_CC: optional "Cc:"
- SMTP_FROM, SMTP_PASSWORD, SMTP_PORT, SMTP_SERVER, STMP_USERNAME: self explanatory

ChangeLog:

        * .github/workflows/send-emails.yml: New file.
Since f1982cc, we are using
clang-format-16 instead of clang-format-10. This commit updates the
clang-format version documented in CONTRIBUTING.md so that new
contributors don't get tripped.

ChangeLog:

	* CONTRIBUTING.md: Update clang-format version

Signed-off-by: Ryo Yoshida <[email protected]>
An imbricated exported macro leads to a segfault.

gcc/rust/ChangeLog:

	* metadata/rust-export-metadata.cc (ExportContext::emit_macro):
	Change method argument NodeId to AST::MacroRulesDefinition.
	* metadata/rust-export-metadata.h:
	Likewise.
	* util/rust-hir-map.cc (Mappings::insert_exported_macro):
	Insert AST::MacroRulesDefinition instead of NodeId.
	* util/rust-hir-map.h:
	Change methods declarations of exported macros.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-3617.rs: New test.

Signed-off-by: Lucas Ly Ba <[email protected]>
GIMPLE output for literalpattern_neg.rs test case:

...
  x = -55;
  RUSTTMP.2 = x;
  if (RUSTTMP.2 == 55) goto <D.113>; else goto <D.114>;
  <D.113>:
  {
    RUSTTMP.1 = 1;
    goto <D.107>;
  }
  <D.114>:
  if (RUSTTMP.2 == -55) goto <D.115>; else goto <D.116>;
  <D.115>:
  {
    RUSTTMP.1 = 0;
    goto <D.107>;
  }
  <D.116>:
  if (1 != 0) goto <D.117>; else goto <D.118>;
  <D.117>:
  {
    RUSTTMP.1 = 1;
    goto <D.107>;
  }
...

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (parse_literal_or_range_pattern): Parse minus sign
	properly for LiteralPattern.
	* ast/rust-pattern.h (LiteralPattern): Add has_minus boolean for LiteralPattern.
	* hir/tree/rust-hir-pattern.h (LiteralPattern): Ditto.
	* ast/rust-pattern.cc (LiteralPattern::as_string): Update to include minus sign
	if present.
	* hir/tree/rust-hir.cc (LiteralPattern::as_string): Ditto.
	* hir/rust-ast-lower-pattern.cc (visit(LiteralPattern)): Pass has_minus boolean
	from AST to HIR.
	* backend/rust-compile-pattern.cc (CompilePatternCheckExpr::visit(LiteralPattern)):
	Compile litexpr as negative if minus sign is present.

Signed-off-by: Yap Zhi Heng <[email protected]>
When a const generic with a default value is not trailing, emit an
error.

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_generic_params): Emit
	an error when const generics with a default value is not
	trailing.

gcc/testsuite/ChangeLog:

	* rust/compile/const_generics_17.rs: New test.
	* rust/compile/generics14.rs: New test.

Signed-off-by: vishruth-thimmaiah <[email protected]>
@dkm
Copy link
Member Author

dkm commented Nov 2, 2025

Added the 2 commits that were merged since I've created this branch.

@dkm
Copy link
Member Author

dkm commented Nov 2, 2025

Compared both test results (rebased branch and current master), and both have the same count.

                === rust Summary ===

# of expected passes            10354
# of expected failures          74
# of unsupported tests          7

Polygonalr and others added 3 commits November 2, 2025 20:24
…sitive

GIMPLE output for compile/issue-4242.rs:

...

  x = 1;
  RUSTTMP.2 = x;
  _1 = RUSTTMP.2 >= -55;
  _2 = RUSTTMP.2 < 0;
  _3 = _1 & _2;
  if (_3 != 0) goto <D.112>; else goto <D.113>;
  <D.112>:
  {
    RUSTTMP.1 = 2;
    goto <D.105>;
  }
  <D.113>:
  _4 = RUSTTMP.2 >= -99;
  _5 = RUSTTMP.2 < -55;
  _6 = _4 & _5;
  if (_6 != 0) goto <D.114>; else goto <D.115>;
  <D.114>:
  {
    RUSTTMP.1 = 3;
    goto <D.105>;
  }
...

gcc/rust/ChangeLog:

	* backend/rust-compile-pattern.cc (compile_range_pattern_bound): Set litexpr
	to negative if has_minus is present in the RangePatternBoundLiteral param.

Signed-off-by: Yap Zhi Heng <[email protected]>
Checks whether upper bound of range is not lower or equal to the lower bound.

gcc/rust/ChangeLog:

	* backend/rust-compile-pattern.cc(compilePatternCheckExpr::visit(RangePattern)):
	Add E0579 check to ensure that lower bound is always below upper bound.

Signed-off-by: Yap Zhi Heng <[email protected]>
…se/2025-10-31

This branch has a no-op merge as the last commit:
 - one arm is the "current" development branch from github
 - the other arm is a rebased version of the "current" master branch onto a recent GCC's master

The merge is obtained with "git merge --strategy=ours" to only keep the changes from second arm.
@dkm dkm force-pushed the gerris/rebase/2025-10-31 branch from a094d9a to e3ee956 Compare November 2, 2025 19:26
@dkm dkm merged commit e3ee956 into master Nov 3, 2025
11 of 13 checks passed
@dkm dkm deleted the gerris/rebase/2025-10-31 branch November 3, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.