gccrs: fix ice when setting up regions
num regions is based on the used arguments of regions which can be less than the substutions requirements. So lets check for that and allow anon regions to be created for them. Fixes Rust-GCC#3605 gcc/rust/ChangeLog: * typecheck/rust-tyty-subst.h: check for min range gcc/testsuite/ChangeLog: * rust/compile/issue-3605.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
This commit is contained in:
parent
5d6467f637
commit
e0df215ca5
2 changed files with 6 additions and 1 deletions
|
@ -125,7 +125,7 @@ public:
|
|||
std::vector<Region> subst)
|
||||
{
|
||||
RegionParamList list (num_regions);
|
||||
for (size_t i = 0; i < subst.size (); i++)
|
||||
for (size_t i = 0; i < MIN (num_regions, subst.size ()); i++)
|
||||
list.regions.at (i) = subst.at (i);
|
||||
for (size_t i = subst.size (); i < num_regions; i++)
|
||||
{
|
||||
|
|
5
gcc/testsuite/rust/compile/issue-3605.rs
Normal file
5
gcc/testsuite/rust/compile/issue-3605.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
enum Foo<'a> {}
|
||||
|
||||
enum Bar<'a> {
|
||||
in_band_def_explicit_impl(Foo<'a>),
|
||||
}
|
Loading…
Add table
Reference in a new issue