<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gcc.git, branch devel/rust/master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/'/>
<entry>
<title>const-block: Add testcase</title>
<updated>2025-05-27T11:18:07+00:00</updated>
<author>
<name>Arthur Cohen</name>
<email>arthur.cohen@embecosm.com</email>
</author>
<published>2025-04-15T11:41:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=7e42c1ee80f2b4836f81f546e8c1bf7ecca57210'/>
<id>7e42c1ee80f2b4836f81f546e8c1bf7ecca57210</id>
<content type='text'>
gcc/testsuite/ChangeLog:

	* rust/execute/torture/const_block1.rs: New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc/testsuite/ChangeLog:

	* rust/execute/torture/const_block1.rs: New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>hir: Add const blocks</title>
<updated>2025-05-27T11:18:07+00:00</updated>
<author>
<name>Arthur Cohen</name>
<email>arthur.cohen@embecosm.com</email>
</author>
<published>2025-04-15T11:34:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=70fab4b0ce318ca7de67f5f26726ff5d403025f3'/>
<id>70fab4b0ce318ca7de67f5f26726ff5d403025f3</id>
<content type='text'>
gcc/rust/ChangeLog:

	* hir/tree/rust-hir-expr.h: New classes.
	* hir/tree/rust-hir-full-decls.h: Likewise.
	* hir/tree/rust-hir.cc: Handle AnonConst and ConstBlock.
	* backend/rust-compile-block.cc: Likewise.
	* backend/rust-compile-block.h: Likewise.
	* backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
	* backend/rust-compile-expr.h: Likewise.
	* checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Likewise.
	* checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Likewise.
	* checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Likewise.
	* checks/errors/borrowck/rust-bir-builder-struct.h: Likewise.
	* checks/errors/borrowck/rust-function-collector.h: Likewise.
	* checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
	* checks/errors/privacy/rust-privacy-reporter.h: Likewise.
	* checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
	* checks/errors/rust-const-checker.h: Likewise.
	* checks/errors/rust-hir-pattern-analysis.cc (PatternChecker::visit): Likewise.
	* checks/errors/rust-hir-pattern-analysis.h: Likewise.
	* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
	* checks/errors/rust-unsafe-checker.h: Likewise.
	* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
	(translate_operand_out): Likewise.
	(translate_operand_inout): Likewise.
	(translate_operand_const): Likewise.
	* hir/rust-ast-lower-expr.h: Likewise.
	* hir/rust-hir-dump.cc (Dump::visit): Likewise.
	* hir/rust-hir-dump.h: Likewise.
	* hir/tree/rust-hir-expr-abstract.h: Likewise.
	* hir/tree/rust-hir-expr.cc (AnonConst::AnonConst): Likewise.
	(AnonConst::operator=): Likewise.
	(ConstBlock::ConstBlock): Likewise.
	(ConstBlock::operator=): Likewise.
	* hir/tree/rust-hir-visitor.h:
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
	(typecheck_inline_asm_operand): Likewise.
	* typecheck/rust-hir-type-check-expr.h: Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc/rust/ChangeLog:

	* hir/tree/rust-hir-expr.h: New classes.
	* hir/tree/rust-hir-full-decls.h: Likewise.
	* hir/tree/rust-hir.cc: Handle AnonConst and ConstBlock.
	* backend/rust-compile-block.cc: Likewise.
	* backend/rust-compile-block.h: Likewise.
	* backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
	* backend/rust-compile-expr.h: Likewise.
	* checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Likewise.
	* checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Likewise.
	* checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Likewise.
	* checks/errors/borrowck/rust-bir-builder-struct.h: Likewise.
	* checks/errors/borrowck/rust-function-collector.h: Likewise.
	* checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
	* checks/errors/privacy/rust-privacy-reporter.h: Likewise.
	* checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
	* checks/errors/rust-const-checker.h: Likewise.
	* checks/errors/rust-hir-pattern-analysis.cc (PatternChecker::visit): Likewise.
	* checks/errors/rust-hir-pattern-analysis.h: Likewise.
	* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
	* checks/errors/rust-unsafe-checker.h: Likewise.
	* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
	(translate_operand_out): Likewise.
	(translate_operand_inout): Likewise.
	(translate_operand_const): Likewise.
	* hir/rust-ast-lower-expr.h: Likewise.
	* hir/rust-hir-dump.cc (Dump::visit): Likewise.
	* hir/rust-hir-dump.h: Likewise.
	* hir/tree/rust-hir-expr-abstract.h: Likewise.
	* hir/tree/rust-hir-expr.cc (AnonConst::AnonConst): Likewise.
	(AnonConst::operator=): Likewise.
	(ConstBlock::ConstBlock): Likewise.
	(ConstBlock::operator=): Likewise.
	* hir/tree/rust-hir-visitor.h:
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
	(typecheck_inline_asm_operand): Likewise.
	* typecheck/rust-hir-type-check-expr.h: Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>parser: Add base for parsing const blocks</title>
<updated>2025-05-27T11:18:07+00:00</updated>
<author>
<name>Arthur Cohen</name>
<email>arthur.cohen@embecosm.com</email>
</author>
<published>2025-04-15T15:33:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=01b433d67a6774007b81258c89b11c2b6c84aaab'/>
<id>01b433d67a6774007b81258c89b11c2b6c84aaab</id>
<content type='text'>
gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_const_block_expr): New function.
	* parse/rust-parse.h: Declare it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_const_block_expr): New function.
	* parse/rust-parse.h: Declare it.
</pre>
</div>
</content>
</entry>
<entry>
<title>ast: Add ConstBlock and AnonConst nodes</title>
<updated>2025-05-27T11:18:07+00:00</updated>
<author>
<name>Arthur Cohen</name>
<email>arthur.cohen@embecosm.com</email>
</author>
<published>2025-04-09T16:18:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=81836d352866d83cd9f521d65d516b125accd2dd'/>
<id>81836d352866d83cd9f521d65d516b125accd2dd</id>
<content type='text'>
gcc/rust/ChangeLog:

	* ast/rust-expr.h: Declare AnonConst and ConstBlock and use them.
	* ast/rust-ast-full-decls.h: Likewise.
	* ast/rust-ast.cc: Add implementation for AnonConst and ConstBlock.
	* ast/rust-ast.h: Likewise.
	* ast/rust-ast-collector.cc (TokenCollector::visit): Likewise.
	* ast/rust-ast-collector.h: Likewise.
	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
	* ast/rust-ast-visitor.h: Likewise.
	* expand/rust-derive.h: Likewise.
	* hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
	* hir/rust-ast-lower-base.h: Likewise.
	* hir/rust-ast-lower-expr.cc (translate_operand_const): Likewise.
	* resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
	* resolve/rust-ast-resolve-base.h: Likewise.
	* resolve/rust-ast-resolve-expr.h: Likewise.
	* resolve/rust-ast-resolve-expr.cc: Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc/rust/ChangeLog:

	* ast/rust-expr.h: Declare AnonConst and ConstBlock and use them.
	* ast/rust-ast-full-decls.h: Likewise.
	* ast/rust-ast.cc: Add implementation for AnonConst and ConstBlock.
	* ast/rust-ast.h: Likewise.
	* ast/rust-ast-collector.cc (TokenCollector::visit): Likewise.
	* ast/rust-ast-collector.h: Likewise.
	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
	* ast/rust-ast-visitor.h: Likewise.
	* expand/rust-derive.h: Likewise.
	* hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
	* hir/rust-ast-lower-base.h: Likewise.
	* hir/rust-ast-lower-expr.cc (translate_operand_const): Likewise.
	* resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
	* resolve/rust-ast-resolve-base.h: Likewise.
	* resolve/rust-ast-resolve-expr.h: Likewise.
	* resolve/rust-ast-resolve-expr.cc: Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: Always emit the error highest in the type hierarchy</title>
<updated>2025-05-27T09:27:15+00:00</updated>
<author>
<name>Philip Herron</name>
<email>herron.philip@googlemail.com</email>
</author>
<published>2025-05-20T17:44:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=c77c3494f82da01c85a294a5f9c3a0c5496f8572'/>
<id>c77c3494f82da01c85a294a5f9c3a0c5496f8572</id>
<content type='text'>
The unify code was a bit dumb here where we always set emit_error to false for any
subtypes for example in comparing tuples we always emitted the whole tuple didnt
match the other tuple but really its much better to say expected bool got i32 because
the element types didn't match.

gcc/rust/ChangeLog:

	* typecheck/rust-coercion.cc (TypeCoercionRules::coerce_unsized): dont emit error here
	* typecheck/rust-unify.cc (UnifyRules::resolve_subtype): new helper to handle emit error
	(UnifyRules::expect_adt): call resolve_subtype
	(UnifyRules::expect_reference): likewise
	(UnifyRules::expect_pointer): likewise
	(UnifyRules::expect_array): likewise
	(UnifyRules::expect_slice): likewise
	(UnifyRules::expect_fndef): likewise
	(UnifyRules::expect_fnptr): likewise
	(UnifyRules::expect_tuple): likewise
	(UnifyRules::expect_closure): likewise
	(UnifyRules::expect_opaque): likeiwse
	* typecheck/rust-unify.h: add new helper to header

gcc/testsuite/ChangeLog:

	* rust/compile/traits9.rs: update errors
	* rust/compile/unify-errors1.rs: New test.

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The unify code was a bit dumb here where we always set emit_error to false for any
subtypes for example in comparing tuples we always emitted the whole tuple didnt
match the other tuple but really its much better to say expected bool got i32 because
the element types didn't match.

gcc/rust/ChangeLog:

	* typecheck/rust-coercion.cc (TypeCoercionRules::coerce_unsized): dont emit error here
	* typecheck/rust-unify.cc (UnifyRules::resolve_subtype): new helper to handle emit error
	(UnifyRules::expect_adt): call resolve_subtype
	(UnifyRules::expect_reference): likewise
	(UnifyRules::expect_pointer): likewise
	(UnifyRules::expect_array): likewise
	(UnifyRules::expect_slice): likewise
	(UnifyRules::expect_fndef): likewise
	(UnifyRules::expect_fnptr): likewise
	(UnifyRules::expect_tuple): likewise
	(UnifyRules::expect_closure): likewise
	(UnifyRules::expect_opaque): likeiwse
	* typecheck/rust-unify.h: add new helper to header

gcc/testsuite/ChangeLog:

	* rust/compile/traits9.rs: update errors
	* rust/compile/unify-errors1.rs: New test.

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nr2.0: Fix IfLet pattern handling</title>
<updated>2025-05-27T08:08:14+00:00</updated>
<author>
<name>Owen Avery</name>
<email>powerboat9.gamer@gmail.com</email>
</author>
<published>2025-05-15T00:03:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=ba32a6e460813a94e5f129dbc0e259c300690385'/>
<id>ba32a6e460813a94e5f129dbc0e259c300690385</id>
<content type='text'>
gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc
	(DefaultResolver::visit_if_let_patterns): New function
	definition.
	(DefaultResolver::visit): New IfLetExpr visitor definition.
	* resolve/rust-default-resolver.h
	(DefaultResolver::visit_if_let_patterns): New function
	declaration.
	(DefaultResolver::visit): New IfLetExpr visitor declaration.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Remove
	IfLetExpr visitor definition.
	(Late::visit_if_let_patterns): New function definition.
	* resolve/rust-late-name-resolver-2.0.h (Late::visit): Remove
	IfLetExpr visitor declaration.
	(Late::visit_if_let_patterns): New function declaration.
	* resolve/rust-name-resolution-context.h (BindingSource::IfLet):
	New enumerator.

Signed-off-by: Owen Avery &lt;powerboat9.gamer@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc
	(DefaultResolver::visit_if_let_patterns): New function
	definition.
	(DefaultResolver::visit): New IfLetExpr visitor definition.
	* resolve/rust-default-resolver.h
	(DefaultResolver::visit_if_let_patterns): New function
	declaration.
	(DefaultResolver::visit): New IfLetExpr visitor declaration.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Remove
	IfLetExpr visitor definition.
	(Late::visit_if_let_patterns): New function definition.
	* resolve/rust-late-name-resolver-2.0.h (Late::visit): Remove
	IfLetExpr visitor declaration.
	(Late::visit_if_let_patterns): New function declaration.
	* resolve/rust-name-resolution-context.h (BindingSource::IfLet):
	New enumerator.

Signed-off-by: Owen Avery &lt;powerboat9.gamer@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Adjust included headers in rust-lang.cc</title>
<updated>2025-05-27T08:06:47+00:00</updated>
<author>
<name>Owen Avery</name>
<email>powerboat9.gamer@gmail.com</email>
</author>
<published>2025-05-26T21:11:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=57a1b013474f7724e547d03d8da4f4f179a005a4'/>
<id>57a1b013474f7724e547d03d8da4f4f179a005a4</id>
<content type='text'>
This was upstreamed as part of ea34614225d4d255e58f63206eb12178b870cb4c
but never made it to our downstream repo. I've added Philip as a
co-author, since he wrote the upstream commit.

gcc/rust/ChangeLog:

	* rust-lang.cc: Remove direct inclusion of "config.h" and
	"system.h", move inclusion of "rust-system.h" upwards.

Co-authored-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
Signed-off-by: Owen Avery &lt;powerboat9.gamer@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was upstreamed as part of ea34614225d4d255e58f63206eb12178b870cb4c
but never made it to our downstream repo. I've added Philip as a
co-author, since he wrote the upstream commit.

gcc/rust/ChangeLog:

	* rust-lang.cc: Remove direct inclusion of "config.h" and
	"system.h", move inclusion of "rust-system.h" upwards.

Co-authored-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
Signed-off-by: Owen Avery &lt;powerboat9.gamer@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: Initial support for Return Position Impl Trait</title>
<updated>2025-05-26T19:18:47+00:00</updated>
<author>
<name>Philip Herron</name>
<email>herron.philip@googlemail.com</email>
</author>
<published>2025-05-19T17:02:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=a497ed083516891db184e4e87a4b954dbd23ef06'/>
<id>a497ed083516891db184e4e87a4b954dbd23ef06</id>
<content type='text'>
This is the initial patch for RPIT, we can build on this to handle the
more complex cases but there are enough distinct changes going on here
that it should just get merged now.

RPIT is really a sneaky generic so for example:

  fn foo() -&gt; impl Bar {
      Baz
  }

This is represented as: fn () -&gt; OpaqueType Bar. But when we handle the
coercion site for Baz on impl Bar when we type resolve the function we
know that the underlying type  is Baz. Note this function is _not_ generic
so its using this special OpaqueType and keeping track of the underlying type
in its ty_ref reference hir-id which will resolve to Baz.

This also means if we have a case where maybe this was in an if statement:

  fn foo(a: i32) -&gt; impl Bar {
      if a &gt; 10 {
        Baz
      } else {
        Qux
      }
  }

The rules of impl Bar is that Baz is handled but Baz and Qux are different
underlying types so this is not allowed. The reason is impl traits are not
generic and although from a programmer perspective the callers dont know what
the underlying type is, the compiler _knows_ what it is. So really when
you call a function and get its return position impl trait the compiler knows
what to do and does all whats nessecary to handle calling functions using that
type etc.

gcc/rust/ChangeLog:

	* backend/rust-compile-type.cc (TyTyResolveCompile::visit): we need to resolve the
	underlying type
	* typecheck/rust-substitution-mapper.cc (SubstMapperInternal::visit): just clone
	* typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
	ensure we monomphize to get the underlying
	* typecheck/rust-tyty.cc (BaseType::destructure): handle opaque types
	(OpaqueType::resolve): this is much simpler now
	(OpaqueType::handle_substitions): no longer needed
	* typecheck/rust-tyty.h: update header
	* typecheck/rust-unify.cc (UnifyRules::expect_opaque): unify rules for opaque

gcc/testsuite/ChangeLog:

	* rust/compile/bad-rpit1.rs: New test.
	* rust/execute/torture/impl_rpit1.rs: New test.
	* rust/execute/torture/impl_rpit2.rs: New test.
	* rust/execute/torture/impl_rpit3.rs: New test.

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the initial patch for RPIT, we can build on this to handle the
more complex cases but there are enough distinct changes going on here
that it should just get merged now.

RPIT is really a sneaky generic so for example:

  fn foo() -&gt; impl Bar {
      Baz
  }

This is represented as: fn () -&gt; OpaqueType Bar. But when we handle the
coercion site for Baz on impl Bar when we type resolve the function we
know that the underlying type  is Baz. Note this function is _not_ generic
so its using this special OpaqueType and keeping track of the underlying type
in its ty_ref reference hir-id which will resolve to Baz.

This also means if we have a case where maybe this was in an if statement:

  fn foo(a: i32) -&gt; impl Bar {
      if a &gt; 10 {
        Baz
      } else {
        Qux
      }
  }

The rules of impl Bar is that Baz is handled but Baz and Qux are different
underlying types so this is not allowed. The reason is impl traits are not
generic and although from a programmer perspective the callers dont know what
the underlying type is, the compiler _knows_ what it is. So really when
you call a function and get its return position impl trait the compiler knows
what to do and does all whats nessecary to handle calling functions using that
type etc.

gcc/rust/ChangeLog:

	* backend/rust-compile-type.cc (TyTyResolveCompile::visit): we need to resolve the
	underlying type
	* typecheck/rust-substitution-mapper.cc (SubstMapperInternal::visit): just clone
	* typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
	ensure we monomphize to get the underlying
	* typecheck/rust-tyty.cc (BaseType::destructure): handle opaque types
	(OpaqueType::resolve): this is much simpler now
	(OpaqueType::handle_substitions): no longer needed
	* typecheck/rust-tyty.h: update header
	* typecheck/rust-unify.cc (UnifyRules::expect_opaque): unify rules for opaque

gcc/testsuite/ChangeLog:

	* rust/compile/bad-rpit1.rs: New test.
	* rust/execute/torture/impl_rpit1.rs: New test.
	* rust/execute/torture/impl_rpit2.rs: New test.
	* rust/execute/torture/impl_rpit3.rs: New test.

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: Fix non canonical type bug with tuples</title>
<updated>2025-05-26T19:18:47+00:00</updated>
<author>
<name>Philip Herron</name>
<email>herron.philip@googlemail.com</email>
</author>
<published>2025-05-26T18:30:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=b401e72ba547d2fa595e13f119e3e5e337afc0d9'/>
<id>b401e72ba547d2fa595e13f119e3e5e337afc0d9</id>
<content type='text'>
When working on rpit we needed to change to use a monomorphized clone of
the result of function calls. This ended up causing a verify gimple issue
with tuples because:

  fn test&lt;A, B&gt;(a: A, b: B) -&gt; (A, B)

When passing for example:

  let a = test::&lt;i32, i32&gt; (123, 456) -&gt; (A=i32, B=i32)

The resulting gimple types became:

  const struct (A=i32, B=i32) vs struct (i32, i32)

We removed the VIEW_CONVERT_EXPR support to auto fix this stuff a good
while ago because it hides these kinds of issues because the type hasher
included the A=i32, B=i32 vs the i32, i32 name so updating this to use
get_name instead keeps the naming the same as well as the fields meaning
these types are 100% equivilant and therefore no conversion is required.
This only occurs because tuples are not named types we should really add
more rust specific info on our gimple TYPES.

gcc/rust/ChangeLog:

	* backend/rust-compile-type.cc (TyTyResolveCompile::visit): use get_name
	* typecheck/rust-tyty.cc (TupleType::get_name): likewise

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When working on rpit we needed to change to use a monomorphized clone of
the result of function calls. This ended up causing a verify gimple issue
with tuples because:

  fn test&lt;A, B&gt;(a: A, b: B) -&gt; (A, B)

When passing for example:

  let a = test::&lt;i32, i32&gt; (123, 456) -&gt; (A=i32, B=i32)

The resulting gimple types became:

  const struct (A=i32, B=i32) vs struct (i32, i32)

We removed the VIEW_CONVERT_EXPR support to auto fix this stuff a good
while ago because it hides these kinds of issues because the type hasher
included the A=i32, B=i32 vs the i32, i32 name so updating this to use
get_name instead keeps the naming the same as well as the fields meaning
these types are 100% equivilant and therefore no conversion is required.
This only occurs because tuples are not named types we should really add
more rust specific info on our gimple TYPES.

gcc/rust/ChangeLog:

	* backend/rust-compile-type.cc (TyTyResolveCompile::visit): use get_name
	* typecheck/rust-tyty.cc (TupleType::get_name): likewise

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: Remove unneeded clones untill we have an arena allocator for these tmps</title>
<updated>2025-05-26T18:09:21+00:00</updated>
<author>
<name>Philip Herron</name>
<email>herron.philip@googlemail.com</email>
</author>
<published>2025-05-19T16:42:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=894e6951cfdd4868a396bde68ac01f0ad28326f0'/>
<id>894e6951cfdd4868a396bde68ac01f0ad28326f0</id>
<content type='text'>
Cloning inference variables is very expensive because it means we are indirectly
creating an implicit new inference variable added to the reference chain.

gcc/rust/ChangeLog:

	* checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_base_type_privacy):
	no need for unreachable here
	* typecheck/rust-unify.cc (UnifyRules::commit): dont clone infer vars
	(UnifyRules::expect_inference_variable): likewise

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cloning inference variables is very expensive because it means we are indirectly
creating an implicit new inference variable added to the reference chain.

gcc/rust/ChangeLog:

	* checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_base_type_privacy):
	no need for unreachable here
	* typecheck/rust-unify.cc (UnifyRules::commit): dont clone infer vars
	(UnifyRules::expect_inference_variable): likewise

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
