<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gcc.git/gcc/rust, branch 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>Daily bump.</title>
<updated>2025-11-18T00:21:51+00:00</updated>
<author>
<name>GCC Administrator</name>
<email>gccadmin@gcc.gnu.org</email>
</author>
<published>2025-11-18T00:21:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=0aac01bfa6ea1384bf5cf0de87a52bd9fb9ab37c'/>
<id>0aac01bfa6ea1384bf5cf0de87a52bd9fb9ab37c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: Fix segv in errors in type checking an impl item</title>
<updated>2025-11-17T14:58:19+00:00</updated>
<author>
<name>Philip Herron</name>
<email>herron.philip@googlemail.com</email>
</author>
<published>2025-11-09T22:05:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=93430462afaee6bbb501174794fd060661f0f653'/>
<id>93430462afaee6bbb501174794fd060661f0f653</id>
<content type='text'>
When we typecheck a trait impl block item, at the end we validate it
against the trait definition by doing a final unify but if the type check
fails on the the impl item it returns NULL here. The other issue was that
if we fail to resolve the specified lifetime we return error early, this
changes the typechecking to default to an anon lifetime so we can continue
typechecking.

Fixes Rust-GCC#4188

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit): null guard
	* typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): default to anon

gcc/testsuite/ChangeLog:

	* rust/compile/issue-4188.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>
When we typecheck a trait impl block item, at the end we validate it
against the trait definition by doing a final unify but if the type check
fails on the the impl item it returns NULL here. The other issue was that
if we fail to resolve the specified lifetime we return error early, this
changes the typechecking to default to an anon lifetime so we can continue
typechecking.

Fixes Rust-GCC#4188

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit): null guard
	* typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): default to anon

gcc/testsuite/ChangeLog:

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

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: Support generic constant impl items</title>
<updated>2025-11-17T14:58:19+00:00</updated>
<author>
<name>Philip Herron</name>
<email>herron.philip@googlemail.com</email>
</author>
<published>2025-11-09T20:28:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=792ce42cd3d44cc854c4fd389698abca35a1a039'/>
<id>792ce42cd3d44cc854c4fd389698abca35a1a039</id>
<content type='text'>
Impl items can have constants defined which could in turn be generic this was
not supported by gccrs and missed. So for example:

  impl&lt;T&gt; Foo&lt;T&gt; {
    const MAGIC: usize = mem::size_of::&lt;T&gt;();
  }

This is a normal type parameter but in order to setup the generics we need to
create a synthetic TyTy::FnType so we can bind the parent's impl generics to
the type system and it just works like any other generic item at that point.
Then for example we have:

  impl&lt;const N: usize&gt; Foo&lt;N&gt; {
    const VALUE: usize = N;
  }

Again we consistently bind the this const generic parameter the same way so
the lazy evaluation of the generic can take place.

gcc/rust/ChangeLog:

	* backend/rust-compile-item.cc (CompileItem::visit): support the synthetic function consts
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::Resolve): likewise
	* typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit): create the synth
	* typecheck/rust-tyty.h: new flag for synthetic constant

gcc/testsuite/ChangeLog:

	* rust/execute/torture/const-generics-5.rs: New test.
	* rust/execute/torture/const-generics-6.rs: New test.
	* rust/execute/torture/const-generics-7.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>
Impl items can have constants defined which could in turn be generic this was
not supported by gccrs and missed. So for example:

  impl&lt;T&gt; Foo&lt;T&gt; {
    const MAGIC: usize = mem::size_of::&lt;T&gt;();
  }

This is a normal type parameter but in order to setup the generics we need to
create a synthetic TyTy::FnType so we can bind the parent's impl generics to
the type system and it just works like any other generic item at that point.
Then for example we have:

  impl&lt;const N: usize&gt; Foo&lt;N&gt; {
    const VALUE: usize = N;
  }

Again we consistently bind the this const generic parameter the same way so
the lazy evaluation of the generic can take place.

gcc/rust/ChangeLog:

	* backend/rust-compile-item.cc (CompileItem::visit): support the synthetic function consts
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::Resolve): likewise
	* typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit): create the synth
	* typecheck/rust-tyty.h: new flag for synthetic constant

gcc/testsuite/ChangeLog:

	* rust/execute/torture/const-generics-5.rs: New test.
	* rust/execute/torture/const-generics-6.rs: New test.
	* rust/execute/torture/const-generics-7.rs: New test.

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: Fix const generics handling on array types</title>
<updated>2025-11-17T14:58:19+00:00</updated>
<author>
<name>Philip Herron</name>
<email>herron.philip@googlemail.com</email>
</author>
<published>2025-11-09T15:49:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=db64745c39cd533a10391aa6fa49487d18730b4a'/>
<id>db64745c39cd533a10391aa6fa49487d18730b4a</id>
<content type='text'>
When we were processing generic const param types on arrays the size type
was overriding the const param decl because of a hirid reference mismatch

Fixes Rust-GCC#3879

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): fix mappings

gcc/testsuite/ChangeLog:

	* rust/compile/const_generics_18.rs: New test.
	* rust/compile/const_generics_19.rs: New test.
	* rust/execute/torture/const-generics-3.rs: New test.
	* rust/execute/torture/const-generics-4.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>
When we were processing generic const param types on arrays the size type
was overriding the const param decl because of a hirid reference mismatch

Fixes Rust-GCC#3879

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): fix mappings

gcc/testsuite/ChangeLog:

	* rust/compile/const_generics_18.rs: New test.
	* rust/compile/const_generics_19.rs: New test.
	* rust/execute/torture/const-generics-3.rs: New test.
	* rust/execute/torture/const-generics-4.rs: New test.

Signed-off-by: Philip Herron &lt;herron.philip@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: make invalid inner attributes show error</title>
<updated>2025-11-17T14:58:19+00:00</updated>
<author>
<name>Lucas Ly Ba</name>
<email>lucas.ly-ba@outlook.com</email>
</author>
<published>2025-11-03T16:28:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=c947f6317245047a84b04064125e9871a1cc53a5'/>
<id>c947f6317245047a84b04064125e9871a1cc53a5</id>
<content type='text'>
gcc/rust/ChangeLog:

	* ast/rust-ast.cc (Attribute::is_derive):
	Change is_derive method with its valid path.
	* util/rust-attribute-values.h:
	Delete redudant derive attribute.
	* util/rust-attributes.cc (AttributeChecker::check_inner_attribute):
	Helper method for check_inner_attributes
	(AttributeChecker::check_inner_attributes):
	Implement method for errors check.
	* util/rust-attributes.h:
	Add methods above in header.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba &lt;lucas.ly-ba@outlook.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc/rust/ChangeLog:

	* ast/rust-ast.cc (Attribute::is_derive):
	Change is_derive method with its valid path.
	* util/rust-attribute-values.h:
	Delete redudant derive attribute.
	* util/rust-attributes.cc (AttributeChecker::check_inner_attribute):
	Helper method for check_inner_attributes
	(AttributeChecker::check_inner_attributes):
	Implement method for errors check.
	* util/rust-attributes.h:
	Add methods above in header.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba &lt;lucas.ly-ba@outlook.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: fix ICE on missing pattern in while loop</title>
<updated>2025-11-17T14:58:19+00:00</updated>
<author>
<name>Lucas Ly Ba</name>
<email>lucas.ly-ba@outlook.com</email>
</author>
<published>2025-10-13T11:01:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=eb88b7b6dc7c65955b7349caf5e6d458341921c8'/>
<id>eb88b7b6dc7c65955b7349caf5e6d458341921c8</id>
<content type='text'>
Adds a proper check for missing patterns in while expressions.

Fixes Rust-GCC#4162

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h(Parser&lt;ManagedTokenSource&gt;::parse_while_let_loop_expr):
	Add check for missing pattern.

gcc/testsuite/ChangeLog:
	* rust/compile/issue-4162.rs: New test.

Signed-off-by: Lucas Ly Ba &lt;lucas.ly-ba@outlook.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds a proper check for missing patterns in while expressions.

Fixes Rust-GCC#4162

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h(Parser&lt;ManagedTokenSource&gt;::parse_while_let_loop_expr):
	Add check for missing pattern.

gcc/testsuite/ChangeLog:
	* rust/compile/issue-4162.rs: New test.

Signed-off-by: Lucas Ly Ba &lt;lucas.ly-ba@outlook.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: fix cfg attribute error with literal predicate</title>
<updated>2025-11-17T14:58:18+00:00</updated>
<author>
<name>Lucas Ly Ba</name>
<email>lucas.ly-ba@outlook.com</email>
</author>
<published>2025-11-06T16:26:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=63d2fbc4d105e4bd58394217a1a0db869fa5ff10'/>
<id>63d2fbc4d105e4bd58394217a1a0db869fa5ff10</id>
<content type='text'>
gcc/rust/ChangeLog:

	* ast/rust-ast.cc (MetaItemLitExpr::check_cfg_predicate): Make error.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba &lt;lucas.ly-ba@outlook.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc/rust/ChangeLog:

	* ast/rust-ast.cc (MetaItemLitExpr::check_cfg_predicate): Make error.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba &lt;lucas.ly-ba@outlook.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: fix segfault with empty cfg attribute</title>
<updated>2025-11-17T14:58:18+00:00</updated>
<author>
<name>Lucas Ly Ba</name>
<email>lucas.ly-ba@outlook.com</email>
</author>
<published>2025-11-06T14:57:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=87b9661250fcf029fa5eb1c9173c56bfea5246da'/>
<id>87b9661250fcf029fa5eb1c9173c56bfea5246da</id>
<content type='text'>
gcc/rust/ChangeLog:

	* ast/rust-ast.cc (Attribute::check_cfg_predicate): add cfg path in condition

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba &lt;lucas.ly-ba@outlook.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc/rust/ChangeLog:

	* ast/rust-ast.cc (Attribute::check_cfg_predicate): add cfg path in condition

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba &lt;lucas.ly-ba@outlook.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: fix error multiple cfg predicates</title>
<updated>2025-11-17T14:58:18+00:00</updated>
<author>
<name>Lucas Ly Ba</name>
<email>lucas.ly-ba@outlook.com</email>
</author>
<published>2025-11-06T16:53:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=7dc139172ea3a9e5b4976049933136b1b9e5be98'/>
<id>7dc139172ea3a9e5b4976049933136b1b9e5be98</id>
<content type='text'>
gcc/rust/ChangeLog:

	* ast/rust-ast.cc (Attribute::check_cfg_predicate):
	Make error.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba &lt;lucas.ly-ba@outlook.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc/rust/ChangeLog:

	* ast/rust-ast.cc (Attribute::check_cfg_predicate):
	Make error.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba &lt;lucas.ly-ba@outlook.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gccrs: Add support for binding const generic values to paths</title>
<updated>2025-11-17T14:58:18+00:00</updated>
<author>
<name>Philip Herron</name>
<email>herron.philip@googlemail.com</email>
</author>
<published>2025-11-03T16:48:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=1a8eabdb1e5493e0b8c211b19431631a796c9657'/>
<id>1a8eabdb1e5493e0b8c211b19431631a796c9657</id>
<content type='text'>
Const generics bind values which can be accessed like a normal path but the difference
is that they can be true expression values not just type paths. This patch adds support
to resolving a method inference which passes a generic value into the method and fixes
some missed bugs along the way. The tricky part was that there is a case where in the
return position of a method returning a const param type vs the type of the method
there is a special case in the unify rules so that we unify the specified type of the
const param type not the const param itself.

gcc/rust/ChangeLog:

	* backend/rust-compile-resolve-path.cc: handle const param values
	* typecheck/rust-hir-type-check-item.cc: generate const infer vars when required
	* typecheck/rust-type-util.cc (unify_site_and): handle a null param cleanup
	* typecheck/rust-tyty-util.cc (TyVar::get_implicit_const_infer_var): helper interface
	* typecheck/rust-tyty-util.h: update header prototypes
	* typecheck/rust-tyty.cc (BaseType::is_concrete): correctly handle const types
	(ConstParamType::get_name): emit the specified type
	(ConstParamType::is_equal): fix recursion loop
	* typecheck/rust-unify.cc (UnifyRules::go): const infer vars need cleanup too
	* typecheck/rust-unify.h: support base generics

gcc/testsuite/ChangeLog:

	* rust/execute/torture/const-generics-2.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>
Const generics bind values which can be accessed like a normal path but the difference
is that they can be true expression values not just type paths. This patch adds support
to resolving a method inference which passes a generic value into the method and fixes
some missed bugs along the way. The tricky part was that there is a case where in the
return position of a method returning a const param type vs the type of the method
there is a special case in the unify rules so that we unify the specified type of the
const param type not the const param itself.

gcc/rust/ChangeLog:

	* backend/rust-compile-resolve-path.cc: handle const param values
	* typecheck/rust-hir-type-check-item.cc: generate const infer vars when required
	* typecheck/rust-type-util.cc (unify_site_and): handle a null param cleanup
	* typecheck/rust-tyty-util.cc (TyVar::get_implicit_const_infer_var): helper interface
	* typecheck/rust-tyty-util.h: update header prototypes
	* typecheck/rust-tyty.cc (BaseType::is_concrete): correctly handle const types
	(ConstParamType::get_name): emit the specified type
	(ConstParamType::is_equal): fix recursion loop
	* typecheck/rust-unify.cc (UnifyRules::go): const infer vars need cleanup too
	* typecheck/rust-unify.h: support base generics

gcc/testsuite/ChangeLog:

	* rust/execute/torture/const-generics-2.rs: New test.

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