GCC Rust Monthly Call - 2nd July 2021

2021-06-28 Thread Philip Herron
Hi everyone, It is that time again and we will be having our 4th community call over on Jitsi for the first Friday of the month. * Date: 2nd July 2021 o UTC: 0900 o UK/Ireland UTC+1/BST: 1000 o Central European Summer Time UTC+2: 1100 * Monthly Report: WIP * Agenda (WIP):

Unit Type for Rust

2021-06-28 Thread Philip Herron
Hi everyone, In Rust the language has the notion of the unit type '()', so for example:  fn foo ->i32 { ... }  fn bar() { ... } Foo has the return type i32, and bar has no return type, which means it is unit-type so that it can be a value assignable just like any other function call. You can als

Re: Unit Type for Rust

2021-06-28 Thread Philip Herron
On 28/06/2021 14:49, Philip Herron wrote: > Hi everyone, > > In Rust the language has the notion of the unit type '()', so for example: > >  fn foo ->i32 { ... } >  fn bar() { ... } > > Foo has the return type i32, and bar has no return type, which means it > is unit-type so that it can be a value

Re: Unit Type for Rust

2021-06-28 Thread Segher Boessenkool
On Mon, Jun 28, 2021 at 02:51:22PM +0100, Philip Herron wrote: > On 28/06/2021 14:49, Philip Herron wrote: > > In Rust the language has the notion of the unit type '()', so for example: > > > >  fn foo ->i32 { ... } > >  fn bar() { ... } > > > > Foo has the return type i32, and bar has no return ty

[PATCH] Suppress warning in rust-ast-lower-type.h ASTLowerGenericParam.visit.

2021-06-28 Thread Mark Wielaard
Translating the AST LifetimeType to the HIR LifetimeType causes a warning: warning: ‘ltt’ may be used uninitialized Add a default clause to the switch statement calling gcc_unreachable. This will suppress the warning and make sure that if the AST lifetime type is invalid or a new unknown type we i

Re: [PATCH] Suppress warning in rust-ast-lower-type.h ASTLowerGenericParam.visit.

2021-06-28 Thread Marc via Gcc-rust
Hi, > Translating the AST LifetimeType to the HIR LifetimeType causes a warning: > warning: ‘ltt’ may be used uninitialized Was wondering why this is needed as the switch case covers all enum variants, how can ltt be uninitialized ? I have the same fix locally but was thinking something else was

Re: [PATCH] Suppress warning in rust-ast-lower-type.h ASTLowerGenericParam.visit.

2021-06-28 Thread Mark Wielaard
On Tue, Jun 29, 2021 at 12:06:56AM +0200, Marc wrote: > Hi, > > > Translating the AST LifetimeType to the HIR LifetimeType causes a warning: > > warning: ‘ltt’ may be used uninitialized > > Was wondering why this is needed as the switch case covers all enum > variants, how can ltt be uninitialize

Re: [PATCH] Suppress warning in rust-ast-lower-type.h ASTLowerGenericParam.visit.

2021-06-28 Thread Mark Wielaard
On Tue, Jun 29, 2021 at 12:47:07AM +0200, Mark Wielaard wrote: > On Tue, Jun 29, 2021 at 12:06:56AM +0200, Marc wrote: > > Hi, > > > > > Translating the AST LifetimeType to the HIR LifetimeType causes a warning: > > > warning: ‘ltt’ may be used uninitialized > > > > Was wondering why this is need

Re: [PATCH] Suppress warning in rust-ast-lower-type.h ASTLowerGenericParam.visit.

2021-06-28 Thread Marc via Gcc-rust
Mark Wielaard writes: > On Tue, Jun 29, 2021 at 12:47:07AM +0200, Mark Wielaard wrote: >> On Tue, Jun 29, 2021 at 12:06:56AM +0200, Marc wrote: >> > Hi, >> > >> > > Translating the AST LifetimeType to the HIR LifetimeType causes a >> > > warning: >> > > warning: ‘ltt’ may be used uninitialized