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 uninitialized ? I have the same fix locally but > was thinking something else was causing the error...
LifetimeType is a plain enum, which aren't really their own types, they are really just ints with fancy names. We could make them enum class, which is a strong type. Then the compiler would know the switch really covers all enum (class) variants. But then we have to provide the right scope/type everywhere we use them in the code (which might be a good idea, but is more typing). Cheers, Mark -- Gcc-rust mailing list Gcc-rust@gcc.gnu.org https://gcc.gnu.org/mailman/listinfo/gcc-rust