diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-29 20:06:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 20:06:05 +0000 |
commit | 2d11bfd88c112cecd06243c6525f4b671574be7c (patch) | |
tree | 43a246ec6cb47c36750c7417be2901a12fc19885 /gcc | |
parent | e0c0ef46d21609326927986f4f8efb0e24638ab9 (diff) | |
parent | 1eb53a9d7a82e9ad408ad7253263859203065160 (diff) | |
download | gcc-2d11bfd88c112cecd06243c6525f4b671574be7c.zip gcc-2d11bfd88c112cecd06243c6525f4b671574be7c.tar.gz gcc-2d11bfd88c112cecd06243c6525f4b671574be7c.tar.bz2 |
Merge #535
535: Suppress warning in rust-ast-lower-type.h ASTLowerGenericParam.visit. r=philberty a=dkm
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 immediately know when lowering the AST.
Co-authored-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-type.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-type.h b/gcc/rust/hir/rust-ast-lower-type.h index 5e19850..568a806 100644 --- a/gcc/rust/hir/rust-ast-lower-type.h +++ b/gcc/rust/hir/rust-ast-lower-type.h @@ -281,6 +281,8 @@ public: case AST::Lifetime::LifetimeType::WILDCARD: ltt = HIR::Lifetime::LifetimeType::WILDCARD; break; + default: + gcc_unreachable (); } HIR::Lifetime lt (mapping, ltt, param.get_lifetime ().get_lifetime_name (), |