Fake PR to test the upstreaming of commit up to gerris/rebase-upstream/2026-04-29#4540
Open
dkm wants to merge 9 commits intodkm/upstream-basefrom
Open
Fake PR to test the upstreaming of commit up to gerris/rebase-upstream/2026-04-29#4540dkm wants to merge 9 commits intodkm/upstream-basefrom
dkm wants to merge 9 commits intodkm/upstream-basefrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 🦀