Skip to content

Bump test. #3860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1,127 commits into
base: master
Choose a base branch
from
Draft

Bump test. #3860

wants to merge 1,127 commits into from

Conversation

dkm
Copy link
Member

@dkm dkm commented Jun 26, 2025

No description provided.

@dkm dkm self-assigned this Jun 26, 2025
@dkm dkm marked this pull request as draft June 26, 2025 20:18
@dkm dkm force-pushed the dkm/bump-2025-06-26 branch from d1c858c to 84d63a5 Compare June 26, 2025 20:24
@powerboat9
Copy link
Collaborator

Could we just do a regular merge? It looks like it'd go through with no conflicts

@dkm
Copy link
Member Author

dkm commented Jun 27, 2025

Could we just do a regular merge? It looks like it'd go through with no conflicts

Sounds like we've already discussed all this when we decided how to proceed. At least here is public and other interested parties could chime in (e.g. @thesamesam ).

I would like to use the process as discussed, at least for a few rounds. We can always adjust if something is painful, not friendly, anything else.

The good property of doing this is that the main branch is always mostly ready for the upstreaming. The main branch is always: a few gccrs commits, an empty merge commit with the --strategy=ours which first parent is a sequence of gccrs commits rebased over an upstream gcc base (recent). The git history becomes a bit like the history of the gccrs commit rebased: first parent of the merge is the current series, the second parent is the previous branch (from there, you again have the exact same pattern).

The daily routine is rather easy and doesn't involve to be a git expert to do. See for example my WIP for gerris...

https://github.com/Rust-GCC/gerris/blob/dkm/upstream-command/src/rebaseupstream.rs => this is used to rebase the github branch onto a fresh upstream (it rebases onto a new base, and it moves all the commits that were after the commit before the new one, so that you have: merge<-gccrs sequence<-fresh upstream gcc).

https://github.com/Rust-GCC/gerris/blob/11b5ee7372da00a40a493a88a53a3530cd81d38b/src/upstream.rs#L249 => this is used to prepare the branch before upstreaming. It is not 100% done, but it gives a good start.

I fear that having regular merge would make things harder to read, and the upstreaming would need a different process. Again, I'm not saying it's not a good idea, but I think I like the process as proposed initially and would like to give it a try.

@powerboat9
Copy link
Collaborator

Alright, we can table the discussion for now. I figured I'd bring it up again since #3761 has already been merged.

@dkm
Copy link
Member Author

dkm commented Jun 27, 2025

Alright, we can table the discussion for now. I figured I'd bring it up again since #3761 has already been merged.

The goal, at least as I understand it, is to do similar merge on a weekly basis, with corresponding upstreaming...

@dkm dkm force-pushed the dkm/bump-2025-06-26 branch from 84d63a5 to 142d78e Compare June 30, 2025 19:42
Philip Herron and others added 22 commits July 3, 2025 21:23
Example usage:

docker build . -t gccrs-dev
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp \
    gccrs-dev:latest gccrs -g -O2 -c \
    gcc/testsuite/rust.test/compilable/type_infer1.rs -o type_infer1.o
This will turn on the test-suite which does have a currently failing test
lets see what happens the workflow in github.
This should make sure people are aware about copyright assignment on their first PR.
Signed-off-by: Akshat Agarwal <[email protected]>
Checking for 'unexpected' will also catch XFAIL tests being PASS.
Github Action only triggered on bors-ng controlled branches (trying/staging).
Fixes #324
Adding a code of conduct lays out rules that we can all follow in the project.
... as discussed in
<https://gcc-rust.zulipchat.com/#narrow/stream/266897-general/topic/Testsuite.20results>:

> [...] best practice from what other GCC testsuites are doing), which I hope
> makes clearer the difference between the individual GCC/Rust testsuites:
> 'rust.test/compile' -> 'rust/compile/torture'
> 'rust.test/execute' -> 'rust/execute/torture'
> 'rust.test/unsupported' -> 'rust/compile/xfail'
> 'rust.test/xfail_compile' -> 'rust/compile'

... plus corresponding documentation updates in the '*.exp' files and
elsewhere.
Make template content invisible.
Reverting previous change.
Github is smart enough to filter out this block, but bors is not and pastes it in its commit message.
philberty and others added 27 commits July 3, 2025 21:23
Its valid to unify a closure to an fnptr as we are working on the
fn traits. There are still other issues but this is part of the patch set.

gcc/rust/ChangeLog:

	* typecheck/rust-unify.cc (UnifyRules::expect_fnptr): add unify rules

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

	* resolve/rust-default-resolver.cc (DefaultResolver::visit):
	Call DefaultASTVisitor::visit even on ConstantItem instances
	without expressions.

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/exclude: Remove issue-3642.rs.

Signed-off-by: Owen Avery <[email protected]>
Code for TupleStructPattern compilation previously only assumes that it is derived from
an enum. This commit adds a check for that, and compiles non-enum TupleStructPatterns
similarly to TuplePatterns if it is not an enum.

gcc/rust/ChangeLog:

	* backend/rust-compile-pattern.cc(CompilePatternCheckExpr::visit(TupleStructPattern)):
		Fix error thrown when compiling non-enum TupleStructPattern.

Signed-off-by: Yap Zhi Heng <[email protected]>
Closure calls are not const so this is invalid. This patch fixes two bugs

  1. Make the look at the parent context optional for generics
  2. Ensure we look for non const calls during call expr code-gen

Fixes #3551

gcc/rust/ChangeLog:

	* backend/rust-compile-expr.cc (CompileExpr::visit): add const call check
	* backend/rust-compile-item.cc (CompileItem::visit): ensure we upfront compile types where
	possible
	* backend/rust-compile-item.h: update header
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): make parent ctx optional

gcc/testsuite/ChangeLog:

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

Signed-off-by: Philip Herron <[email protected]>
There was a sily bug where if you reorder this test case to declare A before B
this test would work but its meant to work in any order. So this fixes the bug
during code gen to fall back to our query compile system if this is needed.

Fixes #3525

gcc/rust/ChangeLog:

	* backend/rust-compile-resolve-path.cc: if this fails fall back to query compile

gcc/testsuite/ChangeLog:

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

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

	* rust/compile/macros/builtin/recurse2.rs: Match "abheyho\0" as
	well as "abheyho", to handle slight differences in assembly
	output for null-terminated strings.

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

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

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

	* hir/tree/rust-hir-expr.h (MatchArm::get_outer_attrs): Add getter for outer attributions

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

	* hir/tree/rust-hir-item.h (SelfParam::get_lifetime): Add getter
	for non const lifetime object

Signed-off-by: Ryutaro Okada <[email protected]>
This should make it easier for us to hand identifiers off to the
back end.

gcc/rust/ChangeLog:

	* Make-lang.in (GRS_OBJS): Add rust-ggc.o.
	* backend/rust-compile-base.cc
	(HIRCompileBase::compile_function): Adjust call to
	Backend::function.
	(HIRCompileBase::compile_constant_item): Likewise and adjust
	initialization of Backend::typed_identifier.
	* backend/rust-compile-expr.cc (CompileExpr::visit): Adjust call
	to Backend::label.
	* backend/rust-compile-type.cc (TyTyResolveCompile::visit):
	Adjust initialization of Backend::typed_identifier.
	* rust-backend.h: Add includes.
	(Backend::GGC::Ident): Use Rust::GGC::Ident.
	(struct typed_identifier): Store name as a GGC::Ident rather
	than a std::string and adjust constructors.
	(named_type): Take GGC::Ident/tl::optional<GGC::Ident> rather
	than std::string.
	(global_variable): Likewise.
	(local_variable): Likewise.
	(parameter_variable): Likewise.
	(static_chain_variable): Likewise.
	(label): Likewise.
	(function): Likewise.
	* rust-gcc.cc (named_type): Likewise.
	(global_variable): Likewise.
	(local_variable): Likewise.
	(parameter_variable): Likewise.
	(static_chain_variable): Likewise.
	(label): Likewise.
	(function): Likewise.
	(function_defer_statement): Adjust call to Backend::label.
	(get_identifier_from_string): Remove function.
	(fill_in_fields): Handle adjustments to typed_identifier.
	* util/rust-ggc.cc: New file.
	* util/rust-ggc.h: New file.

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

	* Make-lang.in: Scaffolding new rust-hir-visitor files
	* hir/tree/rust-hir-visitor.h (DefaultHIRVisitor): Declare default HIR visitor
	* hir/tree/rust-hir-visitor.cc  (DefaultHIRVisitor): Define default HIR visitor

Signed-off-by: Ryutaro Okada <[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]>
gcc/rust/ChangeLog:

	* rust-lang.cc: Move version check from C++11 to C++14.

Signed-off-by: Owen Avery <[email protected]>
This patch implements the previously unimplemented type checking for RANGED item
type for TuplePattern, which serves as the start for implementing compilation of
RestPattern.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit(TuplePattern)):
		Implement type checking for ItemType::RANGED.

Signed-off-by: Yap Zhi Heng <[email protected]>
This ensures Session::load_extern_crate doesn't try to use the old name
resolver when nr2.0 is enabled, while also ensuring that nr2.0 handles
external crates.

gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc
	(DefaultResolver::visit_extern_crate): New function.
	(DefaultResolver::visit): New visitor function for ExternCrate.
	* resolve/rust-default-resolver.h
	(DefaultResolver::visit_extern_crate): New function.
	(DefaultResolver::visit): New visitor function for ExternCrate.
	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
	Adjust ExternCrate visitor and rename to...
	(TopLevel::visit_extern_crate): ...here.
	* resolve/rust-toplevel-name-resolver-2.0.h (TopLevel::visit):
	Remove ExternCrate visitor override.
	(TopLevel::visit_extern_crate): New function.
	* rust-session-manager.cc (Session::load_extern_crate): Only run
	name resolution 1.0 if name resolution 2.0 is disabled.

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

	* ast/rust-expr.h: Add getter to locus field.
	* ast/rust-pattern.h (tokenid_to_rangekind): Likewise.
	* hir/tree/rust-hir-item.h: Likewise.
	* hir/tree/rust-hir-visibility.h: Likewise.

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

	* resolve/rust-late-name-resolver-2.0.cc
	(visit_identifier_as_pattern): Handle is_ref and is_mut.
	(Late::visit): Likewise.
	* resolve/rust-name-resolution-context.cc
	(BindingLayer::insert_ident): Likewise.
	(BindingLayer::bind_test): Handle changes to BindingLayer
	fields.
	(BindingLayer::merge): Likewise and emit more error messages.
	* resolve/rust-name-resolution-context.h
	(struct IdentifierMode): New.
	(Binding::has_expected_bindings): New field.
	(Binding::set): Rename field to...
	(Binding::idents): ...here and convert from a set to a map.
	(Binding::Binding): Initialize has_expected_bindings.
	(BindingLayer::insert_ident): Adjust parameters.

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/exclude: Remove torture/alt_patterns1.rs.

Signed-off-by: Owen Avery <[email protected]>
This prioritizes resolution in the language prelude over resolution as a
module.

gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.hxx (ForeverStack::resolve_path):
	Resolve final segments which point to modules.
	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
	Avoid inserting module names into ribs in the type namespace.

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/exclude: Remove issue-3315-2.rs.

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

gcc/rust/ChangeLog:

	* ast/rust-ast.h (reconstruct): New function for calling the `reconstruct_*_impl` method
	and asserting that the new NodeId is different, and then wrap it in a unique_ptr<T>.
	(reconstruct_vec): Likewise, but for vectors of unique_ptr<T>
gcc/rust/ChangeLog:

	* ast/rust-ast.h: Add reconstruct() and reconstruct_impl() for Type nodes.
	* ast/rust-type.h: Implement them.
	* ast/rust-macro.h: Likewise.
	* ast/rust-path.h: Likewise.
gcc/rust/ChangeLog:

	* Make-lang.in: Remove object file for ASTTypeBuilder.
	* ast/rust-ast-builder.h: Remove function.
	* ast/rust-ast-builder.cc (Builder::new_type): Likewise.
	(Builder::new_const_param): Use reconstruct_type() instead.
	(Builder::new_generic_args): Likewise.
	* expand/rust-derive-default.cc (DeriveDefault::visit_struct): Likewise.
	(DeriveDefault::visit_tuple): Likewise.
	* expand/rust-derive-eq.cc (DeriveEq::visit_tuple): Likewise.
	(DeriveEq::visit_struct): Likewise.
	(DeriveEq::visit_enum): Likewise.
	(DeriveEq::visit_union): Likewise.
	* ast/rust-ast-builder-type.cc: Removed.
	* ast/rust-ast-builder-type.h: Removed.
gcc/rust/ChangeLog:

	* ast/rust-ast.h (reconstruct_vec): Pre-allocate size of vector.
gcc/rust/ChangeLog:

	* ast/rust-ast-builder.cc: Remove extra include, fix new formatting.
gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-pattern.cc (visit(TuplePattern)): Fix
		incorrect logic for field size checking.

gcc/testsuite/ChangeLog:

	* rust/compile/tuple_mismatch.rs: Include RestPattern in test.

Signed-off-by: Yap Zhi Heng <[email protected]>
Example GIMPLE output of the match statement for match-restpattern-tuple-1.rs:

...
RUSTTMP.2 = x;
_1 = RUSTTMP.2.__0;
_2 = _1 == 1;
_3 = RUSTTMP.2.__3;
_4 = _3 == 4;
_5 = _2 & _4;
if (_5 != 0) goto <D.109>; else goto <D.110>;
<D.109>:
{
    {

    }
    goto <D.104>;
}
<D.110>:
if (1 != 0) goto <D.111>; else goto <D.112>;
<D.111>:
{
    {

    }
    goto <D.104>;
}
<D.112>:
<D.104>:
...

gcc/rust/ChangeLog:

	* backend/rust-compile-pattern.cc (CompilePatternCheckExpr::visit(TuplePattern)):
		Implement check expression compilation for TuplePatternItems::RANGED.

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

	* lang.opt (frust-name-resolution-2.0): Enable by default.

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/compile.exp: Removed.
	* rust/compile/nr2/exclude: Removed.

Signed-off-by: Owen Avery <[email protected]>
…25-06-26

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 dkm/bump-2025-06-26 branch from 142d78e to 5399542 Compare July 3, 2025 19:24
@dkm
Copy link
Member Author

dkm commented Jul 4, 2025

Not sure why there's an extra warning here, but I have a fix for it that I'll submit later (will be afk until monday)

@powerboat9
Copy link
Collaborator

Oddly enough, it's not an extra warning, it's a missing warning

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.