Skip to content

Fake PR to test the upstreaming of commit up to gerris/rebase-upstream/2026-05-31#4567

Open
dkm wants to merge 19 commits into
dkm/upstream-basefrom
gerris/rebase-upstream/2026-05-31
Open

Fake PR to test the upstreaming of commit up to gerris/rebase-upstream/2026-05-31#4567
dkm wants to merge 19 commits into
dkm/upstream-basefrom
gerris/rebase-upstream/2026-05-31

Conversation

@dkm

@dkm dkm commented May 31, 2026

Copy link
Copy Markdown
Member

This is a fake PR, not meant to be merged. It tries to merge commits to upstream with an upstream base branch dkm/upstream-base.
We're only interested by the CI results.
-- gerris 🦀

fisnikhasani and others added 19 commits May 31, 2026 18:04
Fixes: #4503

gcc/rust/ChangeLog:

	* lang.opt (flag_name_resolution_2_0): Remove.
	* resolve/rust-name-resolver.cc: Remove include.

Signed-off-by: Fisnik Hasani <opensource@fisnikhasani.com>
CompoundAssignmentExpr codegen was missing the final assignment statement
when it was evaluated in a const context.

gcc/rust/ChangeLog:

	* backend/rust-compile-expr.cc (CompileExpr::visit): Emit the
	missing assignment for CompoundAssignmentExpr.

gcc/testsuite/ChangeLog:

	* rust/compile/const-compound-assignment.rs: New test.
	* rust/execute/const-compound-assignment.rs: New test.

Signed-off-by: Islam-Imad <islamimad404@gmail.com>
the problem is cfg-strip emits an error for unstrippable expressions but
doesn't mark the parent for strip, leaving a broken subtree for later
passes to ICE on.

gcc/rust/ChangeLog:

	* expand/rust-cfg-strip.cc (CfgStrip::visit): mark CallExpr for
	strip when function expression fails stripping.
	(CfgStrip::visit): mark ArrayIndexExpr for strip when array or
	index expression fails stripping.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Harishankar <harishankarpp7@gmail.com>
gcc/rust/ChangeLog:

	* util/rust-attributes.cc (__definitions): Add entries for warn
	and deny attributes.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Fixes #3972.

Trait functions without an explicit return type can have a null
`return_type` in `TraitFunctionDecl`. When such declarations are copied,
the copy constructor and assignment operator currently try to clone the
return type unconditionally, and this can lead to an ICE.

Handle this case by keeping `nullptr` when there is no return type to
clone. Also add a regression test for the example from #3972.

gcc/rust/ChangeLog:

	* hir/tree/rust-hir-item.cc (TraitFunctionDecl::TraitFunctionDecl):
	Handle null return types in copy constructor.
	(TraitFunctionDecl::operator=): Likewise.

gcc/testsuite/ChangeLog:

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

Signed-off-by: lishin <lishin1008@gmail.com>
Assert macro handler was missing, insert a basic handler that desugars to
a condition and a call to panic.

gcc/rust/ChangeLog:

	* expand/rust-macro-builtins-log-debug.cc (MacroBuiltin::assert_handler):
	Add basic assert builtin macro handler.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.h: Move declarations from ForeverStack to NRCtx, make most
	of the ForeverStack members public as it helps the Ctx a lot.
	* resolve/rust-forever-stack.hxx: Move implementation of resolve_path methods to NRCtx.
	* resolve/rust-name-resolution-context.h: Declare resolve_path methods.
	* resolve/rust-name-resolution-context.hxx: New file with resolve_path impls.
gcc/rust/ChangeLog:

	* resolve/rust-name-resolution-context.hxx: Do segment resolution in types NS for more
	correctness and correct behavior when later resolving paths that use imports and/or
	modules.
…fidelity

Number literal evaluation and suffix validation should be done after macro expansion,
so we defer these to the parser phase. This preserves source fidelity for macro token
trees.

gcc/rust/ChangeLog:

	* ast/rust-ast-collector.cc (TokenCollector::visit): Update Token::make_int and
	Token::make_float calls to include suffix_start and IntegerLiteralBase::Decimal.
	* expand/rust-macro-builtins-location.cc (MacroBuiltin::column_handler): Pass string
	length and base to Token::make_int.
	(MacroBuiltin::line_handler): Likewise.
	* lex/rust-lex.cc (Lexer::parse_in_type_suffix): Rename to parse_in_suffix and return
	string instead of PrimitiveCoreType.
	(Lexer::parse_in_suffix): Remove underscore stripping to preserve source fidelity for
	macros.
	(Lexer::parse_in_exponent_part): Preserve '+' and '-' characters in the raw string.
	(Lexer::parse_in_decimal): Remove underscore stripping.
	(Lexer::parse_non_decimal_int_literal): Track suffix start index and pass literal base.
	(Lexer::parse_non_decimal_int_literals): Use IntegerLiteralBase enum values instead of
	raw integers.
	(Lexer::parse_decimal_int_or_float): Track suffix string length and pass base parameters
	to token creation.
	* lex/rust-lex.h: Update method signatures for suffix parsing.
	* lex/rust-token.h (enum class IntegerLiteralBase): New enum to represent numeric bases.
	* parse/rust-parse-impl-expr.hxx: use LiteralResolve functions to evaluate raw token
	strings.
	* parse/rust-parse-impl-pattern.hxx: Use evaluated literal strings for INT and FLOAT
	tokens.
	* parse/rust-parse.cc (resolve_literal_suffix): Move suffix validation logic from lexer
	to parser.
	(evaluate_integer_literal): New function to strip underscores and convert to decimal via
	GMP.
	(evaluate_float_literal): New function to strip underscores from floats.
	* parse/rust-parse.h (evaluate_integer_literal): Declare in LiteralResolve namespace.
	(evaluate_float_literal): Likewise.
	(resolve_literal_suffix): Likewise.
	* util/rust-token-converter.cc (from_literal): Safely reconstruct raw text and suffix to
	dynamically determine base and suffix_start for ProcMacros.

gcc/testsuite/ChangeLog:

	* rust/compile/deferred-suffix-validation.rs: New test.
	* rust/compile/evaluate-integer-or-float.rs: New test.
	* rust/compile/tuple-index.rs: New test.

Signed-off-by: Enes Cevik <nsvke@proton.me>
Previously, the lexer evaluated empty non-decimal literals (like 0x, 0b, 0o) as 0.
Now, it emits error E0768 when there are no valid digits.

gcc/rust/ChangeLog:

	* lex/rust-lex.cc (Lexer::parse_non_decimal_int_literal): Emit E0768.

gcc/testsuite/ChangeLog:

	* rust/compile/empty-non-decimal.rs: New test.

Signed-off-by: Enes Cevik <nsvke@proton.me>
rustc_const_stable attributes are used within the core library but were
not properly feature gated. The compiler now rejects their usage when
the feature has not been explicitly enabled.

gcc/rust/ChangeLog:

	* checks/errors/feature/rust-feature-gate.cc (FeatureGate::visit): Add
	a feature gate around rustc_const_stable attributes.

gcc/testsuite/ChangeLog:

	* rust/compile/const-issue1440.rs: Enable staged_api feature.
	* rust/compile/for-loop1.rs: Likewise.
	* rust/compile/for-loop2.rs: Likewise.
	* rust/compile/issue-1031.rs: Likewise.
	* rust/compile/issue-1289.rs: Likewise.
	* rust/compile/iterators1.rs: Likewise.
	* rust/compile/rustc_const_stable.rs: Likewise.
	* rust/compile/torture/issue-1075.rs: Likewise.
	* rust/compile/torture/issue-1432.rs: Likewise.
	* rust/execute/torture/const-generics-7.rs: Likewise.
	* rust/execute/torture/for-loop1.rs: Likewise.
	* rust/execute/torture/for-loop2.rs: Likewise.
	* rust/execute/torture/issue-1120.rs: Likewise.
	* rust/execute/torture/issue-1133.rs: Likewise.
	* rust/execute/torture/issue-1232.rs: Likewise.
	* rust/execute/torture/issue-1436.rs: Likewise.
	* rust/execute/torture/iter1.rs: Likewise.
	* rust/execute/torture/slice-magic.rs: Likewise.
	* rust/execute/torture/slice-magic2.rs: Likewise.
	* rust/execute/torture/str-layout1.rs: Likewise.
	* rust/compile/missing_staged_api.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Fixes #3537
gcc/testsuite/ChangeLog:
	* rust/compile/issue-3537.rs: New test.

Signed-off-by: Harishankar <harishankarpp7@gmail.com>
gcc/rust/ChangeLog:

	* hir/tree/rust-hir-visibility.h: Switch Visibility::VisType to an enum class, adapt
	variants' case.
	* backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl): Use the new enum API.
	* backend/rust-compile-implitem.cc (CompileTraitItem::visit): Likewise.
	* checks/errors/privacy/rust-visibility-resolver.cc
	(VisibilityResolver::resolve_visibility): Likewise.
	* hir/rust-ast-lower.cc (translate_visibility): Likewise.
	* hir/tree/rust-hir.cc (Visibility::to_string): Likewise.
	* metadata/rust-export-metadata.cc (PublicInterface::is_crate_public): Likewise.
	* util/rust-hir-map.cc (Mappings::Mappings): Likewise.
gcc/testsuite/ChangeLog:
	* rust/compile/issue-4158.rs: New test.
Signed-off-by: Harishankar <harishankarpp7@gmail.com>
gcc/testsuite/ChangeLog:
	* rust/compile/issue-4159.rs: New test

Signed-off-by: Harishankar <harishankarpp7@gmail.com>
This change implements backend lowering support for Rust labeled blocks.

Previously, labeled blocks were rejected in "CompileExpr::visit(BlockExpr)"
as unsupported. With this patch, labeled blocks are lowered by introducing
the following :-

1. A backend "LABEL_DECL" used as the jump target for "break 'label".
2. A temporary "Bvariable" used to hold the block’s resulting value.

gcc/rust/ChangeLog:

	* backend/rust-compile-expr.cc (CompileExpr::visit): Lower labeled block.
	(CompileExpr::construct_block_label): Utility function to construct block label.
	(CompileExpr::lookup_label): Utility function to lookup label.
	(CompileExpr::lookup_temp_var): Utility function to lookup block temp variables.
	(CompileExpr::resolve_util): Utility to resolve NodeId to HirId.
	* backend/rust-compile-expr.h: Header functions.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Fix label resolution.

gcc/testsuite/ChangeLog:

	* rust/execute/cf-labeled-block.rs: New test.

Signed-off-by: Islam-Imad <islamimad404@gmail.com>
When an intrisic is used with an incorrect type, prin the location of
the call site, not the declaration.

Fixes #4465.

gcc/rust/ChangeLog:

	* backend/rust-intrinsic-handlers.cc
	(check_for_basic_integer_type): Fixed typo.
	(build_atomic_builtin_name): Update message.
	(unchecked_op, atomic_store, ctlz_handler)
	(cttz_handler, bswap_handler): Use call location.

gcc/testsuite/ChangeLog:

	* rust/compile/bswap.rs: Update error location.
	* rust/compile/ctlz.rs: Likewise.
	* rust/compile/ctlz_nonzero.rs: Likewise.
	* rust/compile/cttz.rs: Likewise.
	* rust/compile/cttz_nonzero.rs: Likewise.
	* rust/compile/torture/intrinsics-5.rs: Likewise.
	* rust/compile/torture/intrinsics-7.rs: Likewise.

Signed-off-by: Jean-Christian CÎRSTEA <jean-christian.cirstea@tuta.com>
gcc/rust/ChangeLog:

	* util/rust-lang-item.h (Rust::LangItem::Kind): Add DROP.
	* util/rust-lang-item.cc (Rust::LangItem::lang_items): Add drop lang item.

gcc/testsuite/ChangeLog:

	* rust/compile/drop-lang-item.rs: New test.

Signed-off-by: lishin <lishin1008@gmail.com>
gcc/rust/ChangeLog:

	* parse/rust-parse-impl.hxx(parse_expr_stmt): Return error early when
	parse_path_in_expression() returns an error node.

Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
@dkm

dkm commented May 31, 2026

Copy link
Copy Markdown
Member Author

Test results are the same as the current github branch.

Older log file: gcc/testsuite/rust/rust.sum
Test run by dkm on Sun May 31 18:55:19 2026
Native configuration is x86_64-pc-linux-gnu

Newer log file: /home/barryallen/dkm/git/gccrs/build/gcc/testsuite/rust/rust.sum
Test run by dkm on Sun May 31 17:09:51 2026
Native configuration is x86_64-pc-linux-gnu

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.