Skip to content

Conversation

@dkm
Copy link
Member

@dkm dkm commented Oct 27, 2025

This is a sync with upstream GCC:

-- gerris 🦀

CastilloDel and others added 30 commits October 27, 2025 19:18
This should prevent new warnings from appearing silently

Signed-off-by: Daniel del Castillo [email protected]
…obs.build-and-check'

That's what I use in my local development enviroment, and I suppose I'll
be the main one touching this file semi-regularly in context of
<#247> "Rebasing against GCC".
…uild-and-check'

This avoids the supposed issue that in case that 'make' fails, the whole
'jobs.build-and-check' stops, and 'Build logs' isn't executed, and thus there's
no indication in the GitHub UI why 'make' failed.

Using a shell pipeline is OK; the exit code of 'make' isn't lost, as per
<https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell>,
'bash' is being run with '-o pipefail'.
…w warnings' step

Run it in scratch directory, too, to not pollute the pristine sources
directory.  Point to <#1026> in case of
failure.
As Thomas Schwinge pointed out, GCC 4.8 is the minimum version to be
used for building current GCC, meaning that we should make an effort to
support it before we consider upstreaming or backporting. The main
differences are probably a less powerful standard template library or
small compilation differences.
This adds a version of the build-and-check job that runs with clang on
macOS.
This will provide some synchronization for output lines, and so will
make comparisons with known warnings as part of CI more reliable.
... when the workflow is ran in a forked repository

Signed-off-by: Zixing Liu <[email protected]>
... to match Rust container image's base image

Signed-off-by: Zixing Liu <[email protected]>
Sometimes, the GCCRS_BUILD file would end up empty. I believe this is
due to how Dockerfiles work in that there was a "race condition" between
the two `RUN` commands. Hopefully this should fix it.
The Remark CI is breaking for seemingly unrelated reasons regarding
JavaScript syntax. Let's disable it in the meantime and investigate so
that our PRs can still get proper feedback
... update Node.js to the latest LTS branch
This is to gate PR's which might break builds on 32bit systems.

Addresses #1439
Change the CI requirements to have seperate jobs for 64 and 32 bit testing.
It also runs both combinations on the gcc4.8 build job. Bors only requires
the normal build check 64bit job to pass to minimize impact.
As discussed in
<https://inbox.sourceware.org/gcc-patches/[email protected]>:

> '-Werror=overloaded-virtual' is implied as by default, we have
> '-Woverloaded-virtual' and '-Werror'.

> '-Wno-unused-parameter' [did] move into
> 'rust-warn'

This reverts #1623 commit b322288.
As discussed in
<https://inbox.sourceware.org/gcc-patches/[email protected]>:

> '-Werror=overloaded-virtual' is implied as by default, we have
> '-Woverloaded-virtual' and '-Werror' [for '--enable-bootstrap' builds].
> ([...])
> (Maybe that isn't active for '--disable-bootstrap' builds, but that's
> "OK".)

For '--disable-bootstrap' builds, we still have '-Woverloaded-virtual', and any
new such diagnostics will be caught by the #1026 "check for new warnings"
machinery, so effectively that does implement '-Werror', too.

> '-Wno-unused-parameter' [did] move into
> 'rust-warn'

This reverts #1585 commit a32ef7a.
This reverts #1585 commit 94d1116.

Conflicts:
	.github/bors_log_expected_warnings
... manually resolved and adjusted; let's see...
powerboat9 and others added 26 commits October 29, 2025 08:31
gcc/rust/ChangeLog:

	* backend/rust-compile-extern.h: Add includes.
	(CompileExternItem::visit): Use get_link_name.
	(CompileExternItem::get_link_name): New static member function.
	* util/rust-attribute-values.h (Attributes::LINK_NAME): New
	static constexpr member variable.
	* util/rust-attributes.cc (__definitions): New entry for
	LINK_NAME.
	* util/rust-ggc.cc: Include "rust-ast.h".
	(Ident::Ident): Add overload for Rust::Identifier.
	* util/rust-ggc.h (class Identifier): Forward declare.
	(Ident::Ident): Add overload for Rust::Identifier.

gcc/testsuite/ChangeLog:

	* rust/execute/torture/link-name.rs: New test.

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

	* ast/rust-pattern.h (StructPatternElements): Rename has_struct_pattern_etc
	to has_rest_pattern, and has_etc to has_rest to signify presense of rest
	patterns more clearly.
	* ast/rust-pattern.cc (StructPatternElements::as_string): Rename variables
	accordingly.
	* ast/rust-ast-collector.cc: Rename variables accordingly.
	* expand/rust-cfg-strip.cc: Rename variables accordingly.
	* parse/rust-parse-impl.h: Rename variable accordingly.
	* hir/tree/rust-hir-pattern.h (StructPatternElements): Add a boolean to track
	presense of rest pattern.
	* hir/rust-ast-lower-pattern.cc (visit(StructPattern)): Add support for
	lowering rest pattern to HIR.
	* typecheck/rust-hir-type-check-pattern.cc (visit(StructPattern)): Remove
	size check when rest pattern is present.

Signed-off-by: Yap Zhi Heng <[email protected]>
Previously, type checking of StructPattern will throw an error if it is used
to match against a tuple struct, even though it is possible to do so in rustc.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-pattern.cc (visit(StructPattern)): Add type check
	support for StructPatterns matching against a TUPLE type ADT.
	* backend/rust-compile-pattern.cc(CompilePatternBindings::visit(StructPattern)):
	Update assert to allow TUPLE type ADTs.
	* hir/tree/rust-hir.cc (StructPatternField::as_string()): Improve info dumped.

Signed-off-by: Yap Zhi Heng <[email protected]>
This adds compilation of libcore up to the AST validation phase to the
testsuite.

gcc/testsuite/ChangeLog:

	* rust/core/core.exp: New test.

Signed-off-by: Owen Avery <[email protected]>
Adds a test to verify extra parentheses are discarded, and the source is
compiled as expected.

Resolves: #2886

gcc/testsuite/ChangeLog:

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

Signed-off-by: Elle Rhumsaa <[email protected]>
gcc/rust/ChangeLog:

	* hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit(TupleStructPattern)):
	Implement lowering of AST::TupleStructItemsHasRest to HIR.
	* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit(TupleStructPattern)):
	Add the respective type checking for AST::TupleStructItemsHasRest
	* checks/errors/rust-hir-pattern-analysis.cc (lower_tuple_pattern):
	Add respective pattern for HAS_REST case.

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

	* backend/rust-compile-pattern.cc: Add compilation support for TupleStructItemsHasRest
	in CompilePatternCheckExpr(TupleStructPattern) & CompilePatternBindings(TupleStructPattern)

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

	* typecheck/rust-hir-type-check-pattern.cc (visit(TupleStructPattern)):
	Update error for mismatched number of fields to use rich_location.

Signed-off-by: Yap Zhi Heng <[email protected]>
Path must be made of a single literal item, otherwise an error should be
thrown.

gcc/rust/ChangeLog:

	* util/rust-attributes.cc (AttributeChecker::check_attribute): Recurse
	within attr input for additional attribute checking.
	(AttributeChecker::visit): Remove empty definition in favor of default
	ast visitor definition.
	* util/rust-attributes.h: Remove now unused prototypes.

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

	* ast/rust-ast.h: Add missing override modifier.
	* ast/rust-path.h: Likewise.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
We still don't know which location should be preferred over the other,
this means that nobody should rely on this function's return value.

gcc/rust/ChangeLog:

	* ast/rust-expr.h: Force crash when retrieving locus.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
Add location for malformed attribute errors and avoid processing of
malformed attributes.

gcc/rust/ChangeLog:

	* ast/rust-ast.cc (AttrInputMetaItemContainer::separate_cfg_attrs):
	Avoid malformed attributes.
	* util/rust-attributes.cc (AttributeChecker::visit): Change location.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
Doc attribute checking was not performed on traits.

gcc/rust/ChangeLog:

	* util/rust-attributes.cc (check_doc_attribute): Change message.
	(AttributeChecker::visit): Add doc attribute checking on traits.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
Converts an assert into an early return during AST parsing.

Resolves: #4145

gcc/rust/ChangeLog:

	* ast/rust-ast.cc (Module::process_file_path): empty module early return

Signed-off-by: Elle Rhumsaa <[email protected]>
gcc/testsuite/ChangeLog:

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

Signed-off-by: Elle Rhumsaa <[email protected]>
This patch refactors the const generic type system to follow the same pattern
as regular type parameters. The monolithic ConstType is split into four
distinct types:

  ConstParamType (generic parameter placeholder)
  ConstValueType (resolved constant value)
  ConstInferType (inference variable)
  ConstErrorType (error sentinel)

gcc/rust/ChangeLog:

	* backend/rust-compile-expr.cc (CompileExpr::array_copied_expr): refactor to new classes
	* backend/rust-compile-pattern.cc (CompilePatternCheckExpr::visit): likewise
	(CompilePatternBindings::visit): likewise
	* backend/rust-compile-type.cc (TyTyResolveCompile::visit): likewise
	* backend/rust-compile-type.h: likewise
	* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal): likewise
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
	* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): likewise
	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
	* typecheck/rust-substitution-mapper.cc (SubstMapperInternal::visit): likewise
	* typecheck/rust-substitution-mapper.h: likewise
	* typecheck/rust-type-util.cc (unify_site_and): remove bad delete (alpine32)
	* typecheck/rust-tyty-call.h: refactor to new classes
	* typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::clone): likewise
	(SubstitutionRef::infer_substitions): likewise
	* typecheck/rust-tyty-util.cc (TyVar::get_implicit_const_infer_var): likewise
	* typecheck/rust-tyty-util.h: likewise
	* typecheck/rust-tyty-variance-analysis-private.h: likewise
	* typecheck/rust-tyty-visitor.h: likewise
	* typecheck/rust-tyty.cc (BaseType::destructure): likewise
	(BaseType::monomorphized_clone): likewise
	(BaseType::is_concrete): likewise
	(VariantDef::clone): likewise
	(VariantDef::monomorphized_clone): likewise
	(ArrayType::as_string): likewise
	(ArrayType::get_capacity): likewise
	(ArrayType::handle_substitions): likewise
	(generate_tree_str): likewise
	(ConstType::ConstType): likewise
	(ConstParamType::ConstParamType): likewise
	(ConstType::accept_vis): likewise
	(ConstParamType::const_kind): likewise
	(ConstParamType::get_symbol): likewise
	(ConstParamType::can_resolve): likewise
	(ConstParamType::resolve): likewise
	(ConstParamType::accept_vis): likewise
	(ConstType::set_value): likewise
	(ConstType::as_string): likewise
	(ConstParamType::as_string): likewise
	(ConstType::clone): likewise
	(ConstParamType::clone): likewise
	(ConstType::get_symbol): likewise
	(ConstParamType::get_name): likewise
	(ConstType::can_resolve): likewise
	(ConstParamType::is_equal): likewise
	(ConstType::resolve): likewise
	(ConstValueType::ConstValueType): likewise
	(ConstValueType::const_kind): likewise
	(ConstValueType::accept_vis): likewise
	(ConstValueType::as_string): likewise
	(ConstValueType::clone): likewise
	(ConstValueType::get_name): likewise
	(ConstValueType::is_equal): likewise
	(ConstValueType::get_value): likewise
	(ConstInferType::ConstInferType): likewise
	(ConstInferType::const_kind): likewise
	(ConstInferType::accept_vis): likewise
	(ConstType::get_name): likewise
	(ConstInferType::as_string): likewise
	(ConstInferType::clone): likewise
	(ConstInferType::get_name): likewise
	(ConstType::is_equal): likewise
	(ConstInferType::is_equal): likewise
	(ConstErrorType::ConstErrorType): likewise
	(ConstErrorType::const_kind): likewise
	(ConstType::handle_substitions): likewise
	(ConstErrorType::accept_vis): likewise
	(ConstErrorType::as_string): likewise
	(ConstErrorType::clone): likewise
	(ConstErrorType::get_name): likewise
	(ConstErrorType::is_equal): likewise
	* typecheck/rust-tyty.h (class BaseConstType): likewise
	(class ConstType): likewise
	(class ConstParamType): likewise
	(class ConstValueType): likewise
	(class ConstInferType): likewise
	(class ConstErrorType): likewise
	* typecheck/rust-unify.cc (UnifyRules::commit): likewise
	(UnifyRules::go): likewise
	(UnifyRules::expect_array): likewise
	(UnifyRules::expect_const): likewise
	* typecheck/rust-unify.h: likewise

Signed-off-by: Philip Herron <[email protected]>
Fixes #3927

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): check
	and properly emit an error when the tuple index is on a non-tuple-struct.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Ryo Yoshida <[email protected]>
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]>
gcc/rust/ChangeLog:

	* typecheck/rust-tyty-util.cc (TyVar::TyVar): Add null check to avoid ICE.
	(TyVar::get_tyty): Return nullptr when lookup fails.
	(TyVar::clone): Handle null base type safely.
	(TyVar::monomorphized_clone): Add fallback for error types.

gcc/testsuite/ChangeLog:

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

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

	* ast/rust-ast.cc (Attribute::is_derive):
	Change string derive to its definition.
	* util/rust-attribute-values.h:
	Add attribute definition derive.
	* util/rust-attributes.cc (AttributeChecker::visit):
	Add method check_inner_attributes.
	(AttributeChecker::check_inner_attributes):
	Check if there is a bad inner attribute.
	* util/rust-attributes.h:
	Add method check_inner_attributes in .h.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba <[email protected]>
gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-base.cc (parse_repr_options): Changed TOKEN_TREE
	assert into error, update malformed repr attribute error message to be inline
	with other attribute error messages.

Signed-off-by: Yap Zhi Heng <[email protected]>
When we typecheck a tuple struct pattern and the type of its path is
an enum, it may refer to the enum itself and not a variant. Emit an
E0532 error on such cases.

Fixes #3917
Fixes #3918
Fixes #3926

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Emit
	an error when the path refers to an enum itself rather than its variant.

gcc/testsuite/ChangeLog:

	* rust/compile/match-tuplestructpattern-non-variant.rs: New test.

Signed-off-by: Ryo Yoshida <[email protected]>
gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-pattern.cc (visit(TuplePattern)): Update HAS_REST
	case to continue to attempt to resolve pattern items after emitting size error.

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

	* ast/rust-ast-pointer-visitor.cc (PointerVisitor::visit):
	Handle the expression contained in an ErrorPropagationExpr.
	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.

Signed-off-by: Owen Avery <[email protected]>
…se/2025-10-27

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-27 branch from 0c4491b to 7572fd7 Compare October 29, 2025 07:33
@dkm
Copy link
Member Author

dkm commented Oct 29, 2025

Ok. I've squashed all my CI for mail stuff and added an extra commit for bumping the macos hardcoded revision.
CI is happy. Will check that both (current master and this one) have the same test results.

@dkm
Copy link
Member Author

dkm commented Oct 29, 2025

current master:


                === rust Summary ===

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

This branch:

                === rust Summary ===

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

So, everything looks good, am going to push the branch.

@dkm dkm merged commit 7572fd7 into master Oct 29, 2025
11 of 13 checks passed
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.