diff options
author | Philip Herron <herron.philip@googlemail.com> | 2025-04-02 21:02:44 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-04-08 10:17:13 +0200 |
commit | 568289b9f83cb1ff43b12adc4494d8cb8997b8d3 (patch) | |
tree | 60dc717464e31d921db7c89b38b185b327027588 /gcc/rust/ast | |
parent | f7fc904335edd53f428d76cd85a7bf3f8b55b2fe (diff) | |
download | gcc-568289b9f83cb1ff43b12adc4494d8cb8997b8d3.zip gcc-568289b9f83cb1ff43b12adc4494d8cb8997b8d3.tar.gz gcc-568289b9f83cb1ff43b12adc4494d8cb8997b8d3.tar.bz2 |
gccrs: Fix ICE when hitting invalid types for generics
We need to check upfront if the type is valid or not. Then
error with a decent message.
Fixes Rust-GCC#3643
Fixes Rust-GCC#3646
Fixes Rust-GCC#3654
Fixes Rust-GCC#3663
Fixes Rust-GCC#3671
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): fix error msg
* typecheck/rust-substitution-mapper.cc (SubstMapper::Resolve): add validation
(SubstMapper::valid_type): new check
(SubstMapper::visit): check if can resolve
* typecheck/rust-substitution-mapper.h: new prototype
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: nr2 is missing type path error
* rust/compile/issue-3643.rs: New test.
* rust/compile/issue-3646.rs: New test.
* rust/compile/issue-3654.rs: New test.
* rust/compile/issue-3663.rs: New test.
* rust/compile/issue-3671.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/ast')
0 files changed, 0 insertions, 0 deletions