Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gccrs: empty match expressions should resolve to ! #3256

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Commits on Nov 21, 2024

  1. gccrs: fix crashes in hir dump since move to references

    gcc/rust/ChangeLog:
    
    	* hir/rust-hir-dump.cc (Dump::visit): add guards
    
    Signed-off-by: Philip Herron <[email protected]>
    philberty committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    01f30ec View commit details
    Browse the repository at this point in the history
  2. 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 #3231
    Fixes #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 <[email protected]>
    philberty committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    e8bc0e1 View commit details
    Browse the repository at this point in the history