diff options
author | Philip Herron <herron.philip@googlemail.com> | 2024-11-21 17:36:34 +0000 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-21 12:33:02 +0100 |
commit | e4a92d706b30fb2e5c39161dc1ff9f4eabbec983 (patch) | |
tree | 63a39eb2b7919eeb6b933985ed8e338631e5fc6a /gcc/tree-vrp.cc | |
parent | 6e90ff47c658f5a5e97b4b3ae1501efb6e076303 (diff) | |
download | gcc-e4a92d706b30fb2e5c39161dc1ff9f4eabbec983.zip gcc-e4a92d706b30fb2e5c39161dc1ff9f4eabbec983.tar.gz gcc-e4a92d706b30fb2e5c39161dc1ff9f4eabbec983.tar.bz2 |
gccrs: empty match expressions should resolve to !
This is a special case in Rust and the ! type can unify with pretty much
anything its almost a inference variable and a unit-type for special cases.
Fixes Rust-GCC/gccrs#3231
Fixes Rust-GCC/gccrs#2567
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (check_match_scrutinee): check for empty match
(CompileExpr::visit): fix assertion
* checks/errors/rust-hir-pattern-analysis.cc (check_match_usefulness): check for empty
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): resolve to !
gcc/testsuite/ChangeLog:
* rust/compile/exhaustiveness1.rs: remove bad check
* rust/compile/issue-2567-1.rs: New test.
* rust/compile/issue-2567-2.rs: New test.
* rust/compile/issue-2567-3.rs: New test.
* rust/compile/issue-3231.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/tree-vrp.cc')
0 files changed, 0 insertions, 0 deletions