diff options
author | Ryutaro Okada <1015ryu88@gmail.com> | 2025-03-30 09:28:41 -0700 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-04-08 10:17:11 +0200 |
commit | db5a399d13b7fdafb7eaa7d299db777615ff0be2 (patch) | |
tree | 5506fc847c2fb4a8198b7306bac659d16e84c92d /gcc/testsuite/rust/compile | |
parent | e33b62eed7fd0a82d758b23252d288585b6790d2 (diff) | |
download | gcc-db5a399d13b7fdafb7eaa7d299db777615ff0be2.zip gcc-db5a399d13b7fdafb7eaa7d299db777615ff0be2.tar.gz gcc-db5a399d13b7fdafb7eaa7d299db777615ff0be2.tar.bz2 |
gccrs: Evaluate the enum's discriminant in a const context
gcc/rust/ChangeLog:
* backend/rust-compile-resolve-path.cc: Evaluate the enum's discriminant in a const context
gcc/testsuite/ChangeLog:
* rust/compile/enum_discriminant1.rs: New test.
Signed-off-by: Ryutaro Okada <1015ryu88@gmail.com>
Diffstat (limited to 'gcc/testsuite/rust/compile')
-rw-r--r-- | gcc/testsuite/rust/compile/enum_discriminant1.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/enum_discriminant1.rs b/gcc/testsuite/rust/compile/enum_discriminant1.rs new file mode 100644 index 0000000..32092b2 --- /dev/null +++ b/gcc/testsuite/rust/compile/enum_discriminant1.rs @@ -0,0 +1,7 @@ +enum Foo { + Bar = 3 + 12, +} + +fn test() -> Foo { // { dg-warning "function is never used" } + return Foo::Bar; +}
\ No newline at end of file |